private void Awake() { _body = new AgentBody(); _physics = new AgentPhysics(transform, GetComponent <Rigidbody2D>(), this); _state = new StateMachine(); _animation = new AgentAnimation(this, GetComponent <SkeletonAnimation>()); _groundcheck = GetComponent <GroundCheck>(); _stats = new AgentStats(this); _agentSkills = GetComponent <AgentSkills>(); _health = GetComponent <AgentHealth>(); _state.ChangeState(new GroundedState(this)); if (tag == "Player") { DeathManager.Player = this; } else { if (DeathManager.Enemies == null) { DeathManager.Enemies = new List <Agent>(); } DeathManager.Enemies.Add(this); } }
protected void sosAgent_ManageSkills(object sender, UcControlArgs e) { AgentSkills.AgentId = e.Id; AgentSkills.UcDataBind(); mvAgent.ActiveViewIndex = 2; }