public Player(BaseCharacterInfo characterInfo, Vector3 pos, Transform parent = null) : base(characterInfo, pos, parent) { GlobalVar.G_Player = this; mainc = this.obj.GetComponent <MainCharacter>(); Assert.IsTrue(mainc != null); cc = this.obj.GetComponent <CharacterController2D>(); Assert.IsTrue(cc != null); this.BaseAttack = 20; this.MaxHp = 100; }
public AbstractPerson(BaseCharacterInfo characterInfo, Vector3 pos, Transform parent = null) { this.characterInfoInfo = characterInfo; this.obj = MemoryMgr.InstantiateGameObject(characterInfo.prefabPath.Path, pos, Quaternion.identity, parent); this.Hp = characterInfo.maxHp; //添加事件监听 OnAddListener(); //开始每帧Update MainLoop.Instance.AddUpdateFunc(Update); //记录每个实例 instanceList.Add(this); }
public TestPerson(BaseCharacterInfo characterInfo, Vector3 pos, Transform parent = null) : base(characterInfo, pos, parent) { new BloodBarUI(this); }