protected override void InternalOnAddedToBattle(EntityParam param) { base.InternalOnAddedToBattle(param); this.fsm.Start(); this.ChangeState(FSMStateType.Idle); }
protected override void InternalOnAddedToBattle(EntityParam param) { base.InternalOnAddedToBattle(param); this.property.Equal(Attr.Team, param.team); this.ApplyLevel(0); this._regenTime = 0f; this._numSkills = this._data.skills.Length; for (int i = 0; i < this._numSkills; i++) { Skill skill = this.skills[i]; skill.OnCreated(this._data.skills[i], this.rid); skill.OnAttrChanged += this.OnSkillAttrChanged; if (skill.isCommon) { skill.Upgrade(); //普攻默认等级1 this.commonSkill = skill; } } this.fsm.Start(); SyncEventHelper.ChangeState(this.rid, FSMStateType.Idle); this.ChangeState(FSMStateType.Idle); this.ActivePassiveBuffs(); }
internal void OnAddedToBattle(EntityParam param) { SyncEventHelper.SpawnEntity(this.GetType().Name, param); this._rid = param.rid; this._data = ModelFactory.GetEntityData(Utils.GetIDFromRID(this._rid)); this.property.Init(this._data); this.property.Equal(Attr.Position, param.position); this.property.Equal(Attr.Direction, param.direction); this.size = this._data.size * this.property.scale; this.bornPosition = param.position; this.bornDirection = param.direction; AIData[] aiDatas = this._data.aiDatas; if (aiDatas != null) { int count = aiDatas.Length; for (int i = 0; i < count; i++) { this.CreateAIEvaluator(aiDatas[i]); } } this.InternalOnAddedToBattle(param); SyncEventHelper.EntityAttrInitialized(this.rid); if (!string.IsNullOrEmpty(this._data.script)) { this._script = new Script(this, this.battle.luaEnv, this._data.script); this._script.Call(Script.S_ON_ENTITY_ADDED_TO_BATTLE); } }
protected override void InternalOnAddedToBattle(EntityParam param) { base.InternalOnAddedToBattle(param); Hashtable def = Defs.GetEntity(this.id); this.detectRange = def.GetFloat("detect_range"); this.angleSpeed = def.GetFloat("angle_speed"); this.angleSpeed2 = def.GetFloat("angle_speed2"); this.dashDelay = def.GetFloat("dash_delay"); this.dashDelay2 = def.GetFloat("dash_delay2"); }
protected virtual void InternalOnAddedToBattle(EntityParam param) { }