地图移动,假装无线地图

This commit is contained in:
xhxy 2025-05-26 22:02:52 +08:00
parent 7dee815bbe
commit b500fa26d1
85 changed files with 18767 additions and 4248 deletions

View File

@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 15e0a8b6d0dae0844950d67b2a540713
TextScriptImporter:
guid: 48c5aab782d6b2b42bbeaa39d8912263
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 386b79b7f96482c4fa3316adfb714c56
TextScriptImporter:
guid: 59e07e9be1094da41aa59094a76f6245
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:

View File

@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 95801730cfd8a0d4fb0a8d36b2c980f2
TextScriptImporter:
guid: 799bb1641c40659418ef0ada9393f878
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 213aa83a9a9470447a3c754a8bf5cbd4
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: f3a014976e486f2428b5d74c734d5692
TextScriptImporter:
guid: f37905d07678e094dbd3ecf04b2178ca
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 37faaaf4e09a3634391b0efdb296e248
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Resources/UI.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fa5fd763507fdca44a6b53823367a9db
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,242 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1833746564988402}
m_IsPrefabParent: 1
--- !u!1 &1000536879369602
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224344664172266994}
m_Layer: 5
m_Name: System
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1626596352593962
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224528120901654286}
m_Layer: 5
m_Name: Mid
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1724830194253646
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224978941312051832}
m_Layer: 5
m_Name: Top
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1833746564988402
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224343169285473586}
- component: {fileID: 223036587299658560}
- component: {fileID: 114021832494636194}
- component: {fileID: 114137876085375776}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1849616466744890
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224591715095882358}
m_Layer: 5
m_Name: Bot
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114021832494636194
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1833746564988402}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1920, y: 1080}
m_ScreenMatchMode: 1
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &114137876085375776
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1833746564988402}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!223 &223036587299658560
Canvas:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1833746564988402}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &224343169285473586
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1833746564988402}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 224591715095882358}
- {fileID: 224528120901654286}
- {fileID: 224978941312051832}
- {fileID: 224344664172266994}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &224344664172266994
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000536879369602}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224343169285473586}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224528120901654286
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1626596352593962}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224343169285473586}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224591715095882358
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1849616466744890}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224343169285473586}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224978941312051832
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1724830194253646}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224343169285473586}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f2e75baaa7141d1459b20bb0c1140221
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,75 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1145598752367304}
m_IsPrefabParent: 1
--- !u!1 &1145598752367304
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4652244556296870}
- component: {fileID: 114555869979058294}
- component: {fileID: 114272970711931058}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4652244556296870
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1145598752367304}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114272970711931058
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1145598752367304}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &114555869979058294
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1145598752367304}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dc636f4d3c3c82e43bfe3d6553c1383a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ using UnityEngine;
public class CameraController : MonoBehaviour
{
[SerializeField] private Transform target;
/* [SerializeField] private Transform target;
[SerializeField] private Vector2 minMaxXY;
@ -24,5 +24,5 @@ public class CameraController : MonoBehaviour
{
transform.position = new Vector3(Mathf.Clamp(target.position.x,-minMaxXY.x,minMaxXY.x) , Mathf.Clamp(target.position.y, -minMaxXY.y, minMaxXY.y), -10);
}
}*/
}

View File

@ -4,7 +4,13 @@ using UnityEngine;
public class GameManager : MonoBehaviour
{
// Start is called before the first frame update
public static GameManager Instance;
public Player player;
private void Awake()
{
Instance = this;
}
void Start()
{
Application.targetFrameRate = 60;

View File

@ -4,15 +4,52 @@ using UnityEngine;
public class Player : MonoBehaviour
{
// Start is called before the first frame update
void Start()
public PlayerInputController playerInputController; //输入事件
public Rigidbody2D rb;
public Vector2 inputDirection;//输入方向的数值
public float moveSpeed;//速度
private void Awake()
{
playerInputController = new PlayerInputController();
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Start()
{
}
private void OnEnable()
{
playerInputController.Enable();
}
private void OnDisable()
{
playerInputController.Disable();
}
void Update()
{
inputDirection = playerInputController.GamePlayer.Move.ReadValue<Vector2>();//读取数值 //wasd移动
}
private void FixedUpdate()
{
Move();
}
public void Move()
{
rb.velocity = new Vector2(inputDirection.x * moveSpeed, inputDirection.y * moveSpeed); //wasd移动
}
}

View File

@ -1,59 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.XR;
public class PlayerController : MonoBehaviour
{
public PlayerInputController playerInputController; //输入事件
public Rigidbody2D rb;
public Vector2 inputDirection;//输入方向的数值
public float moveSpeed;//速度
private void Awake()
{
playerInputController = new PlayerInputController();
rb = GetComponent<Rigidbody2D>();
}
void Start()
{
}
private void OnEnable()
{
playerInputController.Enable();
}
private void OnDisable()
{
playerInputController.Disable();
}
void Update()
{
inputDirection = playerInputController.GamePlayer.Move.ReadValue<Vector2>();//读取数值 //wasd移动
}
private void FixedUpdate()
{
Move();
}
public void Move()
{
rb.velocity = new Vector2(inputDirection.x * moveSpeed, inputDirection.y * moveSpeed); //wasd移动
}
}

View File

@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 8a3d808b0f2014c42a68c6d7546ffc8d

View File

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Reposition : MonoBehaviour
{
private void OnTriggerExit2D(Collider2D collision)
{
if (!collision.CompareTag("Area"))
return;
Debug.Log("Ö´ÐÐ");
Vector3 playerPos = GameManager.Instance.player.transform.position;
Vector3 myPos = transform.position;
float diffX = Mathf.Abs(playerPos.x - myPos.x);
float diffY = Mathf.Abs(playerPos.y - myPos.y);
Vector3 playerDir = GameManager.Instance.player.inputDirection;
float dirX = playerDir.x < 0 ? -1 : 1;
float dirY = playerDir.y < 0 ? -1 : 1;
switch(transform.tag)
{
case "Ground":
if (diffX > diffY)
{
transform.Translate(Vector3.right * dirX * 40);
}
else if(diffX < diffY)
{
transform.Translate(Vector3.up * dirY * 40);
}
break;
case "Enemy":
break;
}
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7dec7728f9173c64a9c1acb99477604b

8
Assets/Scripts.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8951a7acb3079254c91b91e92de78fb9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: acb16d0684778154ab47554acd9e71e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 465f2f9a2cd6bcd4c92abb86ef97ba32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,209 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// A星寻路管理器 单例模式
/// </summary>
public class AStarMgr : BaseManager<AStarMgr>
{
//地图的宽高
private int mapW;
private int mapH;
//地图相关所有的格子对象容器
public AStarNode[,] nodes;
//开启列表
private List<AStarNode> openList = new List<AStarNode>();
//关闭列表
private List<AStarNode> closeList = new List<AStarNode>();
/// <summary>
/// 初始化地图信息
/// </summary>
/// <param name="w"></param>
/// <param name="h"></param>
public void InitMapInfo(int w, int h)
{
//根据宽高 创建格子 阻挡的问题 我们可以随机阻挡
//因为我们现在没有地图相关的数据
//记录宽高 范围
this.mapW = w;
this.mapH = h;
//申明容器可以装多少个格子
nodes = new AStarNode[w, h];
//申明格子 装进去
for ( int i = 0; i < w; ++i )
{
for( int j = 0; j < h; ++j )
{
//我们这里的随机阻挡 只是为了给大家讲逻辑所以这样写
//以后真正的项目中 这些阻挡信息应该是从地图配置文件中读取出来的 不应该是随机的
AStarNode node = new AStarNode(i, j, Random.Range(0, 100) < 20 ? E_Node_Type.Stop : E_Node_Type.Walk);
nodes[i, j] = node;
}
}
}
/// <summary>
/// 寻路方法 提供给外部使用
/// </summary>
/// <param name="startPos"></param>
/// <param name="endPos"></param>
/// <returns></returns>
public List<AStarNode> FindPath(Vector2 startPos, Vector2 endPos)
{
//实际项目中 传入的点往往是 坐标系中的位置
//我们这里省略换算的步骤 直接认为它是传进来的格子坐标
//首先判断 传入的两个点 是否合法
//如果不合法 应该直接 返回null 意味着不能寻路
//1.首先 要在地图范围内
if (startPos.x < 0 || startPos.x >= mapW ||
startPos.y < 0 || startPos.y >= mapH ||
endPos.x < 0 || endPos.x >= mapW ||
endPos.y < 0 || endPos.y >= mapH)
{
Debug.Log("开始或者结束点在地图格子范围外");
return null;
}
//2.要不是阻挡
//应该得到起点和终点 对应的格子
AStarNode start = nodes[(int)startPos.x, (int)startPos.y];
AStarNode end = nodes[(int)endPos.x, (int)endPos.y];
if (start.type == E_Node_Type.Stop ||
end.type == E_Node_Type.Stop)
{
Debug.Log("开始或者结束点是阻挡");
return null;
}
//清空上一次相关的数据 避免他们影响 这一次的寻路计算
//清空关闭和开启列表
closeList.Clear();
openList.Clear();
//把开始点放入关闭列表中
start.father = null;
start.f = 0;
start.g = 0;
start.h = 0;
closeList.Add(start);
while(true)
{
//从起点开始 找周围的点 并放入开启列表中
//左上 x - 1 y - 1
FindNearlyNodeToOpenList(start.x - 1, start.y - 1, 1.4f, start, end);
//上 x y -1
FindNearlyNodeToOpenList(start.x, start.y - 1, 1, start, end);
//右上 x + 1 y - 1
FindNearlyNodeToOpenList(start.x + 1, start.y - 1, 1.4f, start, end);
//左 x - 1 y
FindNearlyNodeToOpenList(start.x - 1, start.y, 1, start, end);
//右 x + 1 y
FindNearlyNodeToOpenList(start.x + 1, start.y, 1, start, end);
//左下 x-1 y +1
FindNearlyNodeToOpenList(start.x - 1, start.y + 1, 1.4f, start, end);
//下 x y + 1
FindNearlyNodeToOpenList(start.x, start.y + 1, 1, start, end);
//右下 x+1 y+1
FindNearlyNodeToOpenList(start.x + 1, start.y + 1, 1.4f, start, end);
//思路判断 开启列表为空 都还没有找到终点 就认为是思路
if (openList.Count == 0)
{
Debug.Log("死路");
return null;
}
//选出开启列表中 寻路消耗最小的点
openList.Sort(SortOpenList);
Debug.Log("****************");
for ( int i = 0; i < openList.Count; ++i )
{
AStarNode node = openList[i];
Debug.Log("点" + node.x + "," + node.y + ":g=" + node.g + "h=" + node.h + "f=" + node.f);
}
//放入关闭列表中 然后再从开启列表中移除
closeList.Add(openList[0]);
//找得这个点 又编程新的起点 进行下一次寻路计算了
start = openList[0];
openList.RemoveAt(0);
//如果这个点已经是终点了 那么得到最终结果返回出去
//如果这个点 不是终点 那么继续寻路
if (start == end)
{
//找完了 找到路径了
List<AStarNode> path = new List<AStarNode>();
path.Add(end);
while(end.father != null)
{
path.Add(end.father);
end = end.father;
}
//列表翻转的API
path.Reverse();
return path;
}
}
}
/// <summary>
/// 排序函数
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
private int SortOpenList(AStarNode a, AStarNode b)
{
if (a.f > b.f)
return 1;
else if (a.f == b.f)
return 1;
else
return -1;
}
/// <summary>
/// 把临近的点放入开启列表中的函数
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
private void FindNearlyNodeToOpenList(int x, int y, float g, AStarNode father, AStarNode end)
{
//边界判断
if (x < 0 || x >= mapW ||
y < 0 || y >= mapH)
return;
//在范围内 再去取点
AStarNode node = nodes[x, y];
//判断这些点 是否是边界 是否是阻挡 是否在开启或者关闭列表 如果都不是 才放入开启列表
if (node == null||
node.type == E_Node_Type.Stop ||
closeList.Contains(node) ||
openList.Contains(node) )
return;
//计算f值
//f = g + h
//记录父对象
node.father = father;
//计算g 我离起点的距离 就是我父亲离起点的距离 + 我离我父亲的距离
node.g = father.g + g;
node.h = Mathf.Abs(end.x - node.x) + Mathf.Abs(end.y - node.y);
node.f = node.g + node.h;
//Debug.Log("点" + node.x + "," + node.y + ":g=" + node.g + "h=" + node.h);
//如果通过了上面的合法验证 就存到开启列表中
openList.Add(node);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fc92b78a6d750d34eaac7ffb59253bd4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,49 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 格子类型
/// </summary>
public enum E_Node_Type
{
//可以走的地方
Walk,
//不能走的阻挡
Stop,
}
/// <summary>
/// A星格子类
/// </summary>
public class AStarNode
{
//格子对象的坐标
public int x;
public int y;
//寻路消耗
public float f;
//离起点的距离
public float g;
//离终点的距离
public float h;
//父对象
public AStarNode father;
//格子的类型
public E_Node_Type type;
/// <summary>
/// 构造函数 传入坐标和格子类型
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="type"></param>
public AStarNode( int x, int y, E_Node_Type type )
{
this.x = x;
this.y = y;
this.type = type;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b6c5cc82da9424b4184fd18c55e37f30
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fd97613a55e1f8449b1d383f4799261d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//1.C#中 泛型的知识
//2.设计模式中 单例模式的知识
public class BaseManager<T> where T:new()
{
private static T instance;
public static T GetInstance()
{
if (instance == null)
instance = new T();
return instance;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0df36fe7932fd2043be7874fde40a0c1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//C#中 泛型知识点
//设计模式 单例模式的知识点
//继承这种自动创建的 单例模式基类 不需要我们手动去拖 或者 api去加了
//想用他 直接 GetInstance就行了
public class SingletonAutoMono<T> : MonoBehaviour where T : MonoBehaviour
{
private static T instance;
public static T GetInstance()
{
if( instance == null )
{
GameObject obj = new GameObject();
//设置对象的名字为脚本名
obj.name = typeof(T).ToString();
//让这个单例模式对象 过场景 不移除
//因为 单例模式对象 往往 是存在整个程序生命周期中的
DontDestroyOnLoad(obj);
instance = obj.AddComponent<T>();
}
return instance;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4ba4e12b72043c74081375782d001f6e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//C#中 泛型知识点
//设计模式 单例模式的知识点
//继承了 MonoBehaviour 的 单例模式对象 需要我们自己保证它的位移性
public class SingletonMono<T> : MonoBehaviour where T: MonoBehaviour
{
private static T instance;
public static T GetInstance()
{
//继承了Mono的脚本 不能够直接new
//只能通过拖动到对象上 或者 通过 加脚本的api AddComponent去加脚本
//U3D内部帮助我们实例化它
return instance;
}
protected virtual void Awake()
{
instance = this as T;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c6c3b3e6259ecdf4994886c52f9bf310
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c084f18afd9a6d49adcd38ef59c70fc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,151 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public interface IEventInfo
{
}
public class EventInfo<T> : IEventInfo
{
public UnityAction<T> actions;
public EventInfo( UnityAction<T> action)
{
actions += action;
}
}
public class EventInfo : IEventInfo
{
public UnityAction actions;
public EventInfo(UnityAction action)
{
actions += action;
}
}
/// <summary>
/// 事件中心 单例模式对象
/// 1.Dictionary
/// 2.委托
/// 3.观察者设计模式
/// 4.泛型
/// </summary>
public class EventCenter : BaseManager<EventCenter>
{
//key —— 事件的名字(比如:怪物死亡,玩家死亡,通关 等等)
//value —— 对应的是 监听这个事件 对应的委托函数们
private Dictionary<string, IEventInfo> eventDic = new Dictionary<string, IEventInfo>();
/// <summary>
/// 添加事件监听
/// </summary>
/// <param name="name">事件的名字</param>
/// <param name="action">准备用来处理事件 的委托函数</param>
public void AddEventListener<T>(string name, UnityAction<T> action)
{
//有没有对应的事件监听
//有的情况
if( eventDic.ContainsKey(name) )
{
(eventDic[name] as EventInfo<T>).actions += action;
}
//没有的情况
else
{
eventDic.Add(name, new EventInfo<T>( action ));
}
}
/// <summary>
/// 监听不需要参数传递的事件
/// </summary>
/// <param name="name"></param>
/// <param name="action"></param>
public void AddEventListener(string name, UnityAction action)
{
//有没有对应的事件监听
//有的情况
if (eventDic.ContainsKey(name))
{
(eventDic[name] as EventInfo).actions += action;
}
//没有的情况
else
{
eventDic.Add(name, new EventInfo(action));
}
}
/// <summary>
/// 移除对应的事件监听
/// </summary>
/// <param name="name">事件的名字</param>
/// <param name="action">对应之前添加的委托函数</param>
public void RemoveEventListener<T>(string name, UnityAction<T> action)
{
if (eventDic.ContainsKey(name))
(eventDic[name] as EventInfo<T>).actions -= action;
}
/// <summary>
/// 移除不需要参数的事件
/// </summary>
/// <param name="name"></param>
/// <param name="action"></param>
public void RemoveEventListener(string name, UnityAction action)
{
if (eventDic.ContainsKey(name))
(eventDic[name] as EventInfo).actions -= action;
}
/// <summary>
/// 事件触发
/// </summary>
/// <param name="name">哪一个名字的事件触发了</param>
public void EventTrigger<T>(string name, T info)
{
//有没有对应的事件监听
//有的情况
if (eventDic.ContainsKey(name))
{
//eventDic[name]();
if((eventDic[name] as EventInfo<T>).actions != null)
(eventDic[name] as EventInfo<T>).actions.Invoke(info);
//eventDic[name].Invoke(info);
}
}
/// <summary>
/// 事件触发(不需要参数的)
/// </summary>
/// <param name="name"></param>
public void EventTrigger(string name)
{
//有没有对应的事件监听
//有的情况
if (eventDic.ContainsKey(name))
{
//eventDic[name]();
if ((eventDic[name] as EventInfo).actions != null)
(eventDic[name] as EventInfo).actions.Invoke();
//eventDic[name].Invoke(info);
}
}
/// <summary>
/// 清空事件中心
/// 主要用在 场景切换时
/// </summary>
public void Clear()
{
eventDic.Clear();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e63fcbef1c635da44a4169c378543950
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 155792b88d0d2fd4fa377973b1b6eb23
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,56 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 1.Input类
/// 2.事件中心模块
/// 3.公共Mono模块的使用
/// </summary>
public class InputMgr : BaseManager<InputMgr>
{
private bool isStart = false;
/// <summary>
/// 构造函数中 添加Updata监听
/// </summary>
public InputMgr()
{
MonoMgr.GetInstance().AddUpdateListener(MyUpdate);
}
/// <summary>
/// 是否开启或关闭 我的输入检测
/// </summary>
public void StartOrEndCheck(bool isOpen)
{
isStart = isOpen;
}
/// <summary>
/// 用来检测按键抬起按下 分发事件的
/// </summary>
/// <param name="key"></param>
private void CheckKeyCode(KeyCode key)
{
//事件中心模块 分发按下抬起事件
if (Input.GetKeyDown(key))
EventCenter.GetInstance().EventTrigger("某键按下", key);
//事件中心模块 分发按下抬起事件
if (Input.GetKeyUp(key))
EventCenter.GetInstance().EventTrigger("某键抬起", key);
}
private void MyUpdate()
{
//没有开启输入检测 就不去检测 直接return
if (!isStart)
return;
CheckKeyCode(KeyCode.W);
CheckKeyCode(KeyCode.S);
CheckKeyCode(KeyCode.A);
CheckKeyCode(KeyCode.D);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9e7a51ff0296bb446a8166d99406817d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7d0d33087bc3a8544b29ad638b1d702a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// Mono的管理者
/// 1.声明周期函数
/// 2.事件
/// 3.协程
/// </summary>
public class MonoController : MonoBehaviour {
private event UnityAction updateEvent;
// Use this for initialization
void Start () {
DontDestroyOnLoad(this.gameObject);
}
// Update is called once per frame
void Update () {
if (updateEvent != null)
updateEvent();
}
/// <summary>
/// 给外部提供的 添加帧更新事件的函数
/// </summary>
/// <param name="fun"></param>
public void AddUpdateListener(UnityAction fun)
{
updateEvent += fun;
}
/// <summary>
/// 提供给外部 用于移除帧更新事件函数
/// </summary>
/// <param name="fun"></param>
public void RemoveUpdateListener(UnityAction fun)
{
updateEvent -= fun;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 88b796d2e5084b642857b9b2c2aa1d3e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,54 @@
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// 1.可以提供给外部添加帧更新事件的方法
/// 2.可以提供给外部添加 协程的方法
/// </summary>
public class MonoMgr : BaseManager<MonoMgr>
{
private MonoController controller;
public MonoMgr()
{
//保证了MonoController对象的唯一性
GameObject obj = new GameObject("MonoController");
controller = obj.AddComponent<MonoController>();
}
/// <summary>
/// 给外部提供的 添加帧更新事件的函数
/// </summary>
/// <param name="fun"></param>
public void AddUpdateListener(UnityAction fun)
{
controller.AddUpdateListener(fun);
}
/// <summary>
/// 提供给外部 用于移除帧更新事件函数
/// </summary>
/// <param name="fun"></param>
public void RemoveUpdateListener(UnityAction fun)
{
controller.RemoveUpdateListener(fun);
}
public Coroutine StartCoroutine(IEnumerator routine)
{
return controller.StartCoroutine(routine);
}
public Coroutine StartCoroutine(string methodName, [DefaultValue("null")] object value)
{
return controller.StartCoroutine(methodName, value);
}
public Coroutine StartCoroutine(string methodName)
{
return controller.StartCoroutine(methodName);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ac23176e235a19b4cafa3f8d3181be0c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0d68eaa70ad28514482335e4a2b1a405
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,139 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class MusicMgr : BaseManager<MusicMgr>
{
//唯一的背景音乐组件
private AudioSource bkMusic = null;
//音乐大小
private float bkValue = 1;
//音效依附对象
private GameObject soundObj = null;
//音效列表
private List<AudioSource> soundList = new List<AudioSource>();
//音效大小
private float soundValue = 1;
public MusicMgr()
{
MonoMgr.GetInstance().AddUpdateListener(Update);
}
private void Update()
{
for( int i = soundList.Count - 1; i >=0; --i )
{
if(!soundList[i].isPlaying)
{
GameObject.Destroy(soundList[i]);
soundList.RemoveAt(i);
}
}
}
/// <summary>
/// 播放背景音乐
/// </summary>
/// <param name="name"></param>
public void PlayBkMusic(string name)
{
if(bkMusic == null)
{
GameObject obj = new GameObject();
obj.name = "BkMusic";
bkMusic = obj.AddComponent<AudioSource>();
}
//异步加载背景音乐 加载完成后 播放
ResMgr.GetInstance().LoadAsync<AudioClip>("Music/BK/" + name, (clip) =>
{
bkMusic.clip = clip;
bkMusic.loop = true;
bkMusic.volume = bkValue;
bkMusic.Play();
});
}
/// <summary>
/// 暂停背景音乐
/// </summary>
public void PauseBKMusic()
{
if (bkMusic == null)
return;
bkMusic.Pause();
}
/// <summary>
/// 停止背景音乐
/// </summary>
public void StopBKMusic()
{
if (bkMusic == null)
return;
bkMusic.Stop();
}
/// <summary>
/// 改变背景音乐 音量大小
/// </summary>
/// <param name="v"></param>
public void ChangeBKValue(float v)
{
bkValue = v;
if (bkMusic == null)
return;
bkMusic.volume = bkValue;
}
/// <summary>
/// 播放音效
/// </summary>
public void PlaySound(string name, bool isLoop, UnityAction<AudioSource> callBack = null)
{
if(soundObj == null)
{
soundObj = new GameObject();
soundObj.name = "Sound";
}
//当音效资源异步加载结束后 再添加一个音效
ResMgr.GetInstance().LoadAsync<AudioClip>("Music/Sound/" + name, (clip) =>
{
AudioSource source = soundObj.AddComponent<AudioSource>();
source.clip = clip;
source.loop = isLoop;
source.volume = soundValue;
source.Play();
soundList.Add(source);
if(callBack != null)
callBack(source);
});
}
/// <summary>
/// 改变音效声音大小
/// </summary>
/// <param name="value"></param>
public void ChangeSoundValue( float value )
{
soundValue = value;
for (int i = 0; i < soundList.Count; ++i)
soundList[i].volume = value;
}
/// <summary>
/// 停止音效
/// </summary>
public void StopSound(AudioSource source)
{
if( soundList.Contains(source) )
{
soundList.Remove(source);
source.Stop();
GameObject.Destroy(source);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 36dc272dfd33e2e409c4553100bba2d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8c5a246777f9b324caae2dee17574744
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,127 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// 抽屉数据 池子中的一列容器
/// </summary>
public class PoolData
{
//抽屉中 对象挂载的父节点
public GameObject fatherObj;
//对象的容器
public List<GameObject> poolList;
public PoolData(GameObject obj, GameObject poolObj)
{
//给我们的抽屉 创建一个父对象 并且把他作为我们pool(衣柜)对象的子物体
fatherObj = new GameObject(obj.name);
fatherObj.transform.parent = poolObj.transform;
poolList = new List<GameObject>() {};
PushObj(obj);
}
/// <summary>
/// 往抽屉里面 压都东西
/// </summary>
/// <param name="obj"></param>
public void PushObj(GameObject obj)
{
//失活 让其隐藏
obj.SetActive(false);
//存起来
poolList.Add(obj);
//设置父对象
obj.transform.parent = fatherObj.transform;
}
/// <summary>
/// 从抽屉里面 取东西
/// </summary>
/// <returns></returns>
public GameObject GetObj()
{
GameObject obj = null;
//取出第一个
obj = poolList[0];
poolList.RemoveAt(0);
//激活 让其显示
obj.SetActive(true);
//断开了父子关系
obj.transform.parent = null;
return obj;
}
}
/// <summary>
/// 缓存池模块
/// 1.Dictionary List
/// 2.GameObject 和 Resources 两个公共类中的 API
/// </summary>
public class PoolMgr : BaseManager<PoolMgr>
{
//缓存池容器 (衣柜)
public Dictionary<string, PoolData> poolDic = new Dictionary<string, PoolData>();
private GameObject poolObj;
/// <summary>
/// 往外拿东西
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public void GetObj(string name, UnityAction<GameObject> callBack)
{
//有抽屉 并且抽屉里有东西
if (poolDic.ContainsKey(name) && poolDic[name].poolList.Count > 0)
{
callBack(poolDic[name].GetObj());
}
else
{
//通过异步加载资源 创建对象给外部用
ResMgr.GetInstance().LoadAsync<GameObject>(name, (o) =>
{
o.name = name;
callBack(o);
});
//obj = GameObject.Instantiate(Resources.Load<GameObject>(name));
//把对象名字改的和池子名字一样
//obj.name = name;
}
}
/// <summary>
/// 换暂时不用的东西给我
/// </summary>
public void PushObj(string name, GameObject obj)
{
if (poolObj == null)
poolObj = new GameObject("Pool");
//里面有抽屉
if (poolDic.ContainsKey(name))
{
poolDic[name].PushObj(obj);
}
//里面没有抽屉
else
{
poolDic.Add(name, new PoolData(obj, poolObj));
}
}
/// <summary>
/// 清空缓存池的方法
/// 主要用在 场景切换时
/// </summary>
public void Clear()
{
poolDic.Clear();
poolObj = null;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3f0a6a9dc0aa6bb4ca0830268a9d9d68
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c71c0cfa02d39f94e9422b57263c6539
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,47 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// 资源加载模块
/// 1.异步加载
/// 2.委托和 lambda表达式
/// 3.协程
/// 4.泛型
/// </summary>
public class ResMgr : BaseManager<ResMgr>
{
//同步加载资源
public T Load<T>(string name) where T:Object
{
T res = Resources.Load<T>(name);
//如果对象是一个GameObject类型的 我把他实例化后 再返回出去 外部 直接使用即可
if (res is GameObject)
return GameObject.Instantiate(res);
else//TextAsset AudioClip
return res;
}
//异步加载资源
public void LoadAsync<T>(string name, UnityAction<T> callback) where T:Object
{
//开启异步加载的协程
MonoMgr.GetInstance().StartCoroutine(ReallyLoadAsync(name, callback));
}
//真正的协同程序函数 用于 开启异步加载对应的资源
private IEnumerator ReallyLoadAsync<T>(string name, UnityAction<T> callback) where T : Object
{
ResourceRequest r = Resources.LoadAsync<T>(name);
yield return r;
if (r.asset is GameObject)
callback(GameObject.Instantiate(r.asset) as T);
else
callback(r.asset as T);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bcabc5d9a63b09741b6454f7b2ab4494
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fdace8161938338488c4553f8a2b4981
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,58 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
/// <summary>
/// 场景切换模块
/// 知识点
/// 1.场景异步加载
/// 2.协程
/// 3.委托
/// </summary>
public class ScenesMgr : BaseManager<ScenesMgr>
{
/// <summary>
/// 切换场景 同步
/// </summary>
/// <param name="name"></param>
public void LoadScene(string name, UnityAction fun)
{
//场景同步加载
SceneManager.LoadScene(name);
//加载完成过后 才会去执行fun
fun();
}
/// <summary>
/// 提供给外部的 异步加载的接口方法
/// </summary>
/// <param name="name"></param>
/// <param name="fun"></param>
public void LoadSceneAsyn(string name, UnityAction fun)
{
MonoMgr.GetInstance().StartCoroutine(ReallyLoadSceneAsyn(name, fun));
}
/// <summary>
/// 协程异步加载场景
/// </summary>
/// <param name="name"></param>
/// <param name="fun"></param>
/// <returns></returns>
private IEnumerator ReallyLoadSceneAsyn(string name, UnityAction fun)
{
AsyncOperation ao = SceneManager.LoadSceneAsync(name);
//可以得到场景加载的一个进度
while(!ao.isDone)
{
//事件中心 向外分发 进度情况 外面想用就用
EventCenter.GetInstance().EventTrigger("进度条更新", ao.progress);
//这里面去更新进度条
yield return ao.progress;
}
//加载完成过后 才会去执行fun
fun();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 81efdd9fcfc0e6b419a73235129610d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ccd1086596eb44e4d9e6d6570623556e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,107 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
/// <summary>
/// 面板基类
/// 帮助我门通过代码快速的找到所有的子控件
/// 方便我们在子类中处理逻辑
/// 节约找控件的工作量
/// </summary>
public class BasePanel : MonoBehaviour
{
//通过里式转换原则 来存储所有的控件
private Dictionary<string, List<UIBehaviour>> controlDic = new Dictionary<string, List<UIBehaviour>>();
// Use this for initialization
protected virtual void Awake () {
FindChildrenControl<Button>();
FindChildrenControl<Image>();
FindChildrenControl<Text>();
FindChildrenControl<Toggle>();
FindChildrenControl<Slider>();
FindChildrenControl<ScrollRect>();
FindChildrenControl<InputField>();
}
/// <summary>
/// 显示自己
/// </summary>
public virtual void ShowMe()
{
}
/// <summary>
/// 隐藏自己
/// </summary>
public virtual void HideMe()
{
}
protected virtual void OnClick(string btnName)
{
}
protected virtual void OnValueChanged(string toggleName, bool value)
{
}
/// <summary>
/// 得到对应名字的对应控件脚本
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="controlName"></param>
/// <returns></returns>
protected T GetControl<T>(string controlName) where T : UIBehaviour
{
if(controlDic.ContainsKey(controlName))
{
for( int i = 0; i <controlDic[controlName].Count; ++i )
{
if (controlDic[controlName][i] is T)
return controlDic[controlName][i] as T;
}
}
return null;
}
/// <summary>
/// 找到子对象的对应控件
/// </summary>
/// <typeparam name="T"></typeparam>
private void FindChildrenControl<T>() where T:UIBehaviour
{
T[] controls = this.GetComponentsInChildren<T>();
for (int i = 0; i < controls.Length; ++i)
{
string objName = controls[i].gameObject.name;
if (controlDic.ContainsKey(objName))
controlDic[objName].Add(controls[i]);
else
controlDic.Add(objName, new List<UIBehaviour>() { controls[i] });
//如果是按钮控件
if(controls[i] is Button)
{
(controls[i] as Button).onClick.AddListener(()=>
{
OnClick(objName);
});
}
//如果是单选框或者多选框
else if(controls[i] is Toggle)
{
(controls[i] as Toggle).onValueChanged.AddListener((value) =>
{
OnValueChanged(objName, value);
});
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 00d27a205b8cb774f8c82a40aa10cc91
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,176 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
/// <summary>
/// UI层级
/// </summary>
public enum E_UI_Layer
{
Bot,
Mid,
Top,
System,
}
/// <summary>
/// UI管理器
/// 1.管理所有显示的面板
/// 2.提供给外部 显示和隐藏等等接口
/// </summary>
public class UIManager : BaseManager<UIManager>
{
public Dictionary<string, BasePanel> panelDic = new Dictionary<string, BasePanel>();
private Transform bot;
private Transform mid;
private Transform top;
private Transform system;
//记录我们UI的Canvas父对象 方便以后外部可能会使用它
public RectTransform canvas;
public UIManager()
{
//创建Canvas 让其过场景的时候 不被移除
GameObject obj = ResMgr.GetInstance().Load<GameObject>("UI/Canvas");
canvas = obj.transform as RectTransform;
GameObject.DontDestroyOnLoad(obj);
//找到各层
bot = canvas.Find("Bot");
mid = canvas.Find("Mid");
top = canvas.Find("Top");
system = canvas.Find("System");
//创建EventSystem 让其过场景的时候 不被移除
obj = ResMgr.GetInstance().Load<GameObject>("UI/EventSystem");
GameObject.DontDestroyOnLoad(obj);
}
/// <summary>
/// 通过层级枚举 得到对应层级的父对象
/// </summary>
/// <param name="layer"></param>
/// <returns></returns>
public Transform GetLayerFather(E_UI_Layer layer)
{
switch(layer)
{
case E_UI_Layer.Bot:
return this.bot;
case E_UI_Layer.Mid:
return this.mid;
case E_UI_Layer.Top:
return this.top;
case E_UI_Layer.System:
return this.system;
}
return null;
}
/// <summary>
/// 显示面板
/// </summary>
/// <typeparam name="T">面板脚本类型</typeparam>
/// <param name="panelName">面板名</param>
/// <param name="layer">显示在哪一层</param>
/// <param name="callBack">当面板预设体创建成功后 你想做的事</param>
public void ShowPanel<T>(string panelName, E_UI_Layer layer = E_UI_Layer.Mid, UnityAction<T> callBack = null) where T:BasePanel
{
if (panelDic.ContainsKey(panelName))
{
panelDic[panelName].ShowMe();
// 处理面板创建完成后的逻辑
if (callBack != null)
callBack(panelDic[panelName] as T);
//避免面板重复加载 如果存在该面板 即直接显示 调用回调函数后 直接return 不再处理后面的异步加载逻辑
return;
}
ResMgr.GetInstance().LoadAsync<GameObject>("UI/" + panelName, (obj) =>
{
//把他作为 Canvas的子对象
//并且 要设置它的相对位置
//找到父对象 你到底显示在哪一层
Transform father = bot;
switch(layer)
{
case E_UI_Layer.Mid:
father = mid;
break;
case E_UI_Layer.Top:
father = top;
break;
case E_UI_Layer.System:
father = system;
break;
}
//设置父对象 设置相对位置和大小
obj.transform.SetParent(father);
obj.transform.localPosition = Vector3.zero;
obj.transform.localScale = Vector3.one;
(obj.transform as RectTransform).offsetMax = Vector2.zero;
(obj.transform as RectTransform).offsetMin = Vector2.zero;
//得到预设体身上的面板脚本
T panel = obj.GetComponent<T>();
// 处理面板创建完成后的逻辑
if (callBack != null)
callBack(panel);
panel.ShowMe();
//把面板存起来
panelDic.Add(panelName, panel);
});
}
/// <summary>
/// 隐藏面板
/// </summary>
/// <param name="panelName"></param>
public void HidePanel(string panelName)
{
if(panelDic.ContainsKey(panelName))
{
panelDic[panelName].HideMe();
GameObject.Destroy(panelDic[panelName].gameObject);
panelDic.Remove(panelName);
}
}
/// <summary>
/// 得到某一个已经显示的面板 方便外部使用
/// </summary>
public T GetPanel<T>(string name) where T:BasePanel
{
if (panelDic.ContainsKey(name))
return panelDic[name] as T;
return null;
}
/// <summary>
/// 给控件添加自定义事件监听
/// </summary>
/// <param name="control">控件对象</param>
/// <param name="type">事件类型</param>
/// <param name="callBack">事件的响应函数</param>
public static void AddCustomEventListener(UIBehaviour control, EventTriggerType type, UnityAction<BaseEventData> callBack)
{
EventTrigger trigger = control.GetComponent<EventTrigger>();
if (trigger == null)
trigger = control.gameObject.AddComponent<EventTrigger>();
EventTrigger.Entry entry = new EventTrigger.Entry();
entry.eventID = type;
entry.callback.AddListener(callBack);
trigger.triggers.Add(entry);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 016c19915f9f9ae41aeaf1ff84082dbd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 B

View File

@ -1,152 +0,0 @@
fileFormatVersion: 2
guid: 0c4f47951a0b5124998614539fcecbed
TextureImporter:
internalIDToNameTable:
- first:
213: -4263702999252029208
second: 32rogues-palette_0
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: 32rogues-palette_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 16
height: 4
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 8e0b0d556b844d4c0800000000000000
internalID: -4263702999252029208
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable:
32rogues-palette_0: -4263702999252029208
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,4 +0,0 @@
"32rogues" may be used in both non-commercial and commercial projects, excluding those relating to or containing non-fungible tokens ("NFT"), blockchain-related projects. It may not be used in conjunction with generative artificial intelligence proejcts or machine learning projects. You may modify it to suit your needs. You may not redistribute or resell it. Credit is not necessary, but very much appreciated.
Copyright 2024 Seth Boyles

View File

@ -1,101 +0,0 @@
1.a. grizzly bear
1.b. black bear
1.c. polar bear
1.d. panda
2.a. chimpanzee
2.b. gorilla
3.c. orangutan
4.a. aye aye
4.b. gibbon
4.c. mandrill
4.d. capuchin
4.e. langur
5.a. cat
5.b. bobcat
5.c. cougar
5.d. cheetah
5.e. lynx
5.f. ocelot
5.g. male lion
5.h. female lion
6.a. dog
6.b. puppy
6.c. hyena
6.d. fox
6.e. jackal
6.f. coyote
6.g. wolf
7.a. capybara
7.b. beaver
7.c. mink
7.d. mongoose
7.e. marmot
7.f. groundhog
7.g. chinchilla
7.h. echidna
8.a. aardvark
8.b. armadillo
8.c. badger
8.d. honeybadger
8.e. coati
8.f. opossum
8.g. rabbit
8.h. hare
8.i. rat
9.a. snake
9.b. cobra
9.c. kingsnake
9.d. black mamba
10.a. alligator
10.b. monitor lizard
10.c. iguana
10.d. tortoise
10.e. snapping turtle
10.f. alligator snapping turtle
11.a. cow
11.b. horse
11.c. donkey
11.d. mule
11.e. alpaca
11.f. llama
11.g. pig
11.h. boar
12.a. camel
12.b. reindeer/caribou
12.c. water buffalo
12.d. yak
13.a. seagull
13.b. barn owl
13.c. common buzzard
14.a. kangaroo
14.b. koala
15.a. penguin
15.b. little penguin
15.c. cassowary
15.d. emu
16.a. chicken
16.b. rooster
16.c. mallard duck
16.d. swan
16.e. turkey
16.f. guineafowl
16.g. peacock
17.a. goat
17.b. mountain goat
17.c. ibex
17.d. sheep (ram)
16.e. sheep (ewe)

View File

@ -1,12 +0,0 @@
1. brazier (unlit)
2. brazier (lit)
3. fire pit (unlit)
4. fire pit (lit)
5. torch (unlit)
6. torch (lit)
7. lamp (unlit)
8. lamp (lit)
9. fire
10. small fire
11. water waves
12. poison bubbles

View File

@ -1,2 +0,0 @@
water tiles
poison swamp tiles

View File

@ -1,179 +0,0 @@
1.a. dagger
1.b. short sword
1.c. short sword 2
1.d. long sword
1.e. bastard sword
1.f. zweihander
1.g. sanguine dagger
1.h. magic dagger
1.i. crystal sword
1.j. evil sword
1.k. flame sword
2.a. wide short sword
2.b. wide long sword
2.c. rapier
2.d. long rapier
2.e. flamberge
2.f. large flamberge
2.g. great sword
3.a. shotel
3.b. scimitar
3.c. large scimitar
3.d. great scimitar
3.e. kukri
4.a. hand axe
4.b. battle axe
4.c. halberd
4.d. great axe
4.e. giant axe
4.f. hatchet
4.g. woodcutter's axe
5.a. blacksmiths hammer
5.b. short warhammer
5.c. long warhammer
5.d. hammer
5.e. great hammer
6.a. mace 1
6.b. mace 2
6.c. great mace
6.d. spiked bat
7.a. spear
7.b. short spear
7.c. pitchfork
7.d. trident
7.e. magic spear
8.a. flail 1
8.b. flail 2
8.c. flail 3
9.a. club
9.b. spiked club
9.c. great club
9.d. club with nails
10.a. crossbow
10.b. short bow
10.c. long bow
10.d. long bow 2
10.e. large crossbow
11.a. crystal staff
11.b. holy staff
11.c. druid staff
11.d. blue staff
11.e. golden staff
11.f. red crystal staff
11.g. flame staff
11.h. blue crystal staff
11.i. cross staff
11.j. saint's staff
12.a. buckler
12.b. kite shield
12.c. cross shield
12.d. dark shield
12.e. round shield
12.f. buckler 2
12.g. large shield
13.a. cloth armor
13.b. leather armor
13.c. robe
13.d. chain mail
13.e. scale mail
13.f. chest plate
14.a. cloth gloves
14.b. leather gloves
14.c. blue cloth gloves
14.d. gauntlets
15.a. shoes
15.b. leather boots
15.c. high blue boots
15.d. greaves
16.a. cloth hood
16.b. leather helm
16.c. wide-brimmed hat
16.d. chain mail coif
16.e. helm
16.f. helm with chain mail
16.g. plate helm 1
16.h. plate helm 2
17.a. red pendant
17.b. metal pendant
17.c. crystal pendant
17.d. disc pendant
17.e. cross pendant
17.f. stone pendant
17.g. ankh
18.a. gold emerald ring
18.b. gold band ring
18.c. green signet ring
18.d. ruby ring
18.e. sapphire ring
18.f. onyx ring
19.a. gold signet ring
19.b. silver signet ring
19.c. jade ring
19.d. silver signet ring
19.e. twisted gold ring
19.f. twisted metal ring
20.a. purple potion
20.b. red potion
20.c. brown vial
20.d. large dark potion
20.e. green potion
21.a. black potion
21.b. bright green potion
21.c. pink vial
21.d. blue potion
21.e. orange potion
22.a. scroll
22.b. book
22.c. red book
22.d. dark tome
22.e. tome
22.f. tome 2
22.g. scroll 2
22.h. page
23.a. gold key
23.b. ornate key
23.c. metal key
23.d. primitive key
24.a. arrow
24.b. arrows
24.c. bolt
24.d. bolts
25.a. coin
25.b. small stacks of coins
25.c. large stacks of coins
25.d. coin purse
26.a. cheese
26.b. bread
26.c. apple
26.d. bottle of beer
25.e. bottle of water

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 98cc3bf6bce6d5a4780c738c042c58a7
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,76 +0,0 @@
1.a. orc
1.b. orc wizard
1.c. goblin
1.d. orc blademaster
1.e. orc warchief
1.f. goblin archer
1.g. goblin mage
1.h. goblin brute
2.a. ettin
2.b. two headed ettin
2.c. troll
3.a. small slime
3.b. big slime
3.c. slimebody
3.d. merged slimebodies
4.a. faceless monk
4.b. unholy cardinal
5.a. skeleton
5.b. skeleton archer
5.c. lich
5.d. death knight
5.e. zombie
5.f. ghoul
6.a. banshee
6.b. reaper
6.c. wraith
6.d. cultist
6.e. hag/witch
7.a. giant centipede
7.b. lampreymander
7.c. giant earthworm
7.d. manticore
7.e. giant ant
7.f. lycanthrope
7.g. giant bata
7.h. lesser giant ant
7.i. giant spider
7.j. lesser giant spider
7.k. warg/dire wolf
7.l. giant rat
8.a. dryad
8.b. wendigo
8.c. rock golem
8.d. centaur
8.e. naga
8.f. forest spirit
8.g. satyr
8.h. minotaur
8.i. harpy
8.j. gorgon/medusa
9.a. lizardfolk / kobold (reptile)
9.b. drake / lesser dragon
9.c. dragon
9.d. cockatrice
9.e. basilisk
10.a. small kobold (canine)
10.b. kobold (canine)
11.a. small myconid
11.b. large myconid
12.a. angel / archangel
12.b. imp / devil
13.a. small writhing mass
13.b. large writhing mass
13.c. writhing humanoid

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5983a652c96681940841b2f88eb7133b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,46 +0,0 @@
1.a. dwarf
1.b. elf
1.c. ranger
1.d. rogue
1.e. bandit
2.a. knight
2.b. male fighter
2.c. female knight
2.d. female knight (helmetless)
2.e. shield knight
3.a. monk
3.b. priest
3.c. female war cleric
3.d. male war cleric
3.e. templar
3.f. schema monk
3.g. elder schema monk
4.a. male barbarian
4.b. male winter barbarian
4.c. female winter barbarian
4.d. swordsman
4.e. fencer
4.f. female barbarian
5.a. female wizard
5.b. male wizard
5.c. druid
5.d. desert sage
5.e. dwarf mage
6.f. warlock
7.a. farmer (wheat thresher)
7.b. farmer (scythe)
7.c. farmer (pitchfork)
7.d. baker
7.e. blacksmith
7.f. scholar
8.a. peasant / coalburner
8.b. peasant
8.c. shopkeep
8.d. elderly woman
8.e. elderly man

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: a38fd21490191ff459a49ac5cb8fcceb
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,163 +0,0 @@
1.a. dirt wall (top)
1.b. dirt wall (side)
1.c. inner wall
2.a. rough stone wall (top)
2.b. rough stone wall (side)
3.a. stone brick wall (top)
3.b. stone brick wall (side 1)
3.c. stone brick wall (side 2)
4.a. igneous wall (top)
4.b. igneous wall (side)
5.a. large stone wall (top)
5.b. large stone wall (side)
6.a. catacombs / skull wall (top)
6.b. catacombs / skull walls (side)
7.a. blank floor (dark grey)
7.b. floor stone 1
7.c. floor stone 2
7.d. floor stone 3
7.e. floor stone 1 (no bg)
7.f. floor stone 2 (no bg)
7.g. floor stone 3 (no bg)
8.a. blank floor (dark purple)
8.b. grass 1
8.c. grass 2
8.d. grass 3
8.e. grass 1 (no bg)
8.f. grass 2 (no bg)
8.g. grass 3 (no bg)
9.a. empty
9.b. dirt 1
9.c. dirt 2
9.d. dirt 3
9.e. dirt 1 (no bg)
9.f. dirt 2 (no bg)
9.g. dirt 3 (no bg)
10.a. empty
10.b. stone floor 1
10.c. stone floor 2
10.d. stone floor 3
10.e. stone floor 1 (no bg)
10.f. stone floor 2 (no bg)
10.g. stone floor 3 (no bg)
11.a. empty
11.b. bone 1
11.c. bone 2
11.d. bone 3
11.e. bone 1 (no bg)
11.f. bone 2 (no bg)
11.g. bone 3 (no bg)
12.a. blank red floor
12.b. red stone floor 1 (red bg)
12.c. red stone floor 2 (red bg)
12.d. red stone floor 3 (red bg)
12.e. red stone floor 1 (no bg)
12.f. red stone floor 2 (no bg)
12.g. red stone floor 3 (no bg)
13.a. blank blue floor
13.b. blue stone floor 1 (blue bg)
13.c. blue stone floor 2 (blue bg)
13.d. blue stone floor 3 (blue bg)
14.a. blank green floor
14.b. dirt 1 (green bg)
14.c. dirt 2 (green bg)
14.d. dirt 3 (green bg)
15.a. empty
15.b. grass 1 (green bg)
15.c. grass 2 (green bg)
15.d. grass 3 (green bg)
16.a. dark brown bg
16.b. bones 1 (dark brown bg)
16.c. bones 2 (dark brown bg)
16.d. bones 3 (dark brown bg)
17.a. door 1
17.b. door 2
17.c. framed door 1 (shut)
17.d. framed door 1 (open)
17.e. framed door 2 (shut)
17.f. framed door 2 (open)
17.g. grated door
17.h. staircase down
17.i. staircase up
17.j. pressure plate (up)
17.k. pressure plate (down)
17.l. chute
17.m. pit
17.n. trap door
17.o. pentagram
17.p. spikes (down)
17.q. spites (up)
18.a. chest (closed)
18.b. chest (open)
18.c. jar (closed)
18.d. jar (open)
18.e. barrel
18.f. ore sack
18.g. log pile
19.a. large rock 1
19.b. large rock 2
20.a. buckwheet
20.b. flax
20.c. papyrus sedge
20.d. kenaf
20.e. ramie
20.f. jute
20.g. rice
20.h. wheat
20.i. maize / corn
20.j. amaranth
20.k. quinoa
20.l. bitter vetch
20.m. sorghum
20.n. red spinach
20.o. cotton
20.p. alfalfa
21.a. small mushrooms
21.b. large mushroom
22.a. corpse (bones) 1
22.b. corpse (bones) 2
23.a. blood spatter 1
23.b. blood spatter 2
23.c. slime (small)
23.d. slime (large)
24.a. coffin (closed)
24.b. coffin (ajar)
24.c. coffin (open)
24.d. sarcophagus (closed)
24.e. sarcophagus (ajar)
24.f. sarcophagus (open)
26.a. sapling
26.b. small tree
26.c. tree
26.d. two tile tree

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: a3161462a8c4f15418d1284fd013dc87
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,167 +0,0 @@
fileFormatVersion: 2
guid: 03feeae7da4d15745978a3bfb511fad3
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 62a9f0aa5b59740cfbadc7e5f9823bb0, type: 3}
textureImporterSettings:
alphaSource: 1
mipMapMode: 0
enableMipMap: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
convertToNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
swizzle: 50462976
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
nPOTScale: 1
sRGBTexture: 1
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 0
flipbookColumns: 0
ignorePngGamma: 0
cookieMode: 0
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
normalMap: 0
textureFormat: 0
maxTextureSize: 0
lightmap: 0
compressionQuality: 0
linearTexture: 0
grayScaleToAlpha: 0
rGBM: 0
cubemapConvolutionSteps: 0
cubemapConvolutionExponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
previousAsepriteImporterSettings:
fileImportMode: 1
importHiddenLayers: 0
layerImportMode: 1
defaultPivotSpace: 0
defaultPivotAlignment: 7
customPivotPosition: {x: 0.5, y: 0.5}
mosaicPadding: 4
spritePadding: 0
generateModelPrefab: 1
generateAnimationClips: 1
addSortingGroup: 1
addShadowCasters: 0
asepriteImporterSettings:
fileImportMode: 1
importHiddenLayers: 0
layerImportMode: 1
defaultPivotSpace: 0
defaultPivotAlignment: 7
customPivotPosition: {x: 0.5, y: 0.5}
mosaicPadding: 4
spritePadding: 0
generateModelPrefab: 1
generateAnimationClips: 1
addSortingGroup: 1
addShadowCasters: 0
importFileNodeState: 1
platformSettingsDirtyTick: 0
textureAssetName:
singleSpriteImportData:
- name:
originalName:
pivot: {x: 0, y: 0}
alignment: 0
border: {x: 0, y: 0, z: 0, w: 0}
rect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
spriteID:
spriteBone: []
spriteOutline: []
vertices: []
spritePhysicsOutline: []
indices:
edges: []
tessellationDetail: 0
uvTransform: {x: 0, y: 0}
animatedSpriteImportData:
- name: Props-Rocks
originalName:
pivot: {x: 0.50352114, y: -0.021276597}
alignment: 9
border: {x: 0, y: 0, z: 0, w: 0}
rect:
serializedVersion: 2
x: 4
y: 4
width: 284
height: 329
spriteID: 2ac9e8f10b519374280a4eae9f4164ab
spriteBone: []
spriteOutline: []
vertices: []
spritePhysicsOutline: []
indices:
edges: []
tessellationDetail: 0
uvTransform: {x: 4, y: 4}
spriteSheetImportData: []
asepriteLayers:
- layerIndex: 0
guid: -900389763
name: Props-Rocks
layerFlags: 0
layerType: 0
blendMode: 0
cells:
- name: Props-Rocks
frameIndex: 0
cellRect:
x: 1
y: 7
width: 284
height: 329
spriteId: 2ac9e8f10b519374280a4eae9f4164ab
linkedCells: []
parentIndex: -1
platformSettings: []
generatePhysicsShape: 0
secondarySpriteTextures: []
spritePackingTag:
canvasSize: {x: 288, y: 336}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -356,11 +356,11 @@ TextureImporter:
name: Base-01_0
rect:
serializedVersion: 2
x: 0
y: 207
width: 81
height: 97
alignment: 0
x: 63
y: 224
width: 16
height: 16
alignment: 9
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
@ -587,10 +587,10 @@ TextureImporter:
name: Base-01_11
rect:
serializedVersion: 2
x: 94
y: 222
width: 20
height: 20
x: 96
y: 224
width: 16
height: 16
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}

View File

@ -10,7 +10,7 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13312, guid: 0000000000000000e000000000000000, type: 0}
m_Name: Wall
m_Name: Ground
m_EditorClassIdentifier:
m_Sprite: {fileID: -7166688175291046560, guid: 522ea26485b2ad2419f0fd1c01933aba, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}

View File

@ -3,7 +3,9 @@
--- !u!78 &1
TagManager:
serializedVersion: 2
tags: []
tags:
- Ground
- Area
layers:
- Default
- TransparentFX