SqlSugar是.Net版本,可以在NuGet上下载。
MySql是类库形式新建的。
SqlSugar是.Net版本,可以在NuGet上下载。
MySql是类库形式新建的。
有限状态机
int m;
int[] w ={0,3,4,5};
int[] p = {0,4,5,6};
static void int Exhaustivity(int m,int[] w,int[] p)
{
}
GameRoot:ContextView需要挂载在游戏物体上
void Awake(){
context=new GameContext(this,true);
context.Start();
}
GameContext:MVCSContext
public GameContext(MonoBehaviour view,bool autoMapping):base(view,autoMapping)
protected override void mapBindings()
绑定都是在GameContext中进行
从这里开始,前面的准备工作差不多完成了,剩下的就是游戏逻辑的工作了。
1、给Ground添加AI-navimesh组件,选择Agent height, 点击bake
2、调整角色高度,确保能应用到导航
笛卡尔坐标系:
1.笛卡尔直角坐标系
2.笛卡尔斜角坐标系
3.笛卡尔坐标系的度量单位一致
4.第一象限++,第二象限-+,第三象限+-,第四--
WHERE和HAVING的区别:WHERE是一个约束声明,是在对查询结果进行分组前,将不符合WHERE条件的行去掉,即在分组之前过滤数据。WHERE语句中不能包含聚组函数。WHERE语句显示特定的行。HAVING是一个过滤声明,是筛选满足条件的组,即在分组之后过滤数据。HAVING语句中可以包含聚组函数。HAVING语句显示特定的组。WHERE语句在GROUP BY之前执行,HAVING语句在GROUP BY之后执行。
LIKE 模式匹配 注:_ 只能匹配一个字符,% 能匹配任何一个字符序列(包括空序列在内)
lightmap 灯光烘焙 , 静态场景的lightmap settings 下面的 scale in lightmap 就是烘焙的权重, 0-1, 次要选择0.2
light设置下,
light resolution 是光的分辨率 烘焙影响很大
lightmap resolution 是形成的贴图的分辨率, 烘焙 影响很大
final gether 是贴图连接处的平滑度,
directional mode 是光作用于贴图的法线, 决定立体感。
开启全局光照烘焙, 设置减性substractive , 就是动态用实时光照, 其他全部烘焙。
fog雾的效果, 不在场景内, 是摄像机 , 参数为距离摄像机的 开始距离结束距离。
烘焙出来的文件就是在当前场景的文件夹
AudioListener 只需要一个 并且不能销毁, 放在管理物体,
一个数据库对应一个SqlSugarClient
一个表对应一个实体类
string[] resDependence = AssetDatabase.GetAssetBundleDependencies(abBase.ABName, true);
static void CreateConfig(Dictionary<string, string> validPathABNameDict)
{
AssetBundleConfig config = new AssetBundleConfig();
config.ABList = new List<ABBase>();
foreach (string path in validPathABNameDict.Keys)
{
ABBase abBase = new ABBase();
abBase.Path = path;
abBase.Crc = Crc32.GetCRC32(path);
abBase.ABName = validPathABNameDict[path];
abBase.AssetName = path.Remove(0, path.LastIndexOf("/") + 1);
abBase.ABDependence = new List<string>();
string[] resDependence = AssetDatabase.GetAssetBundleDependencies(abBase.ABName, true);
foreach (string de in resDependence)
{
//Debug.LogFormat($"AB包:{abBase.ABName} ------ 依赖{de}");
abBase.ABDependence.Add(de);
}
config.ABList.Add(abBase);
}
//写入XML
.
.
.
//写入二进制
.
.
.
小bug:多次加载会重复添加,需要在加载前清理inventory。
1、把角色的自动寻路组件设置为默认不开启。当角色生成并设置到正确的位置后再启用
在OnEnable方法中调用Invoke(NavMesh.Enabled,0.001f)
Inspector》Awake》OnEnable》
Start
补充UIManager脚本
1.GameUIManager()
{isGameUIManager=true;
if(UIPanelDict.Count!=0){
ClearDict();}}
2.GamePanel文件夹添加脚本继承GameBasePanel
DayNigth,GuardPanel,Hunter,Prophet,Witch,Wolf;
GetRelatedPos之前应该需要清空数组吧
创建一个类使之继承自ScriptableObject 表示把这个类变成可以自定义资源配置的文件
实体类内字段名一般应和数据库表内列名一致,否则需要标注别名。
除Awake以外 都可以控制脚本对象的setActive状态
类内枚举必须用类名.出来
Inspector>外部调用(外部赋值)>Awake>OnEnable>Start
完善UIManager
1.GameUIManager()
定义GameBasePanel
dayNightPanel,wolfPanel,guardPanel,witchPanel,prophetPanel,hunterPanel
完善任务链wolfPanel.SetNextPanel(witchPanel).SetNextPanel(prophetPanel).SetNextPanel(hunterPanel).SetNextPanel(defenderPanel).SetNextPanel(dayNightPanel).SetNextPanel(wolfPanel);
字典添加界面内容
UIPanelDict[UIPanelTypeWolfPanel].Show();
GameBasePanel firstPanel=UIPanelDict[UIPanelType.WolfPanel] as GameBasePanel;
firstPanel.EnterPanel();
firstPanel.HandleGameAcition(UIPanel.WolfPanel);
2.BasePanel()
ChangePanelCallBack(UIPanelType otherPanel)函数增加
if(uiManager.isGameUIManager){
GameBasePanel nextPanel=uiManager.UIPanelDict[otherPanel] as GameBasePanel;
nextPanel.HandleGameAction(otherPanel);}