protected new void Awake() { base.Awake(); this.statemgr = this.GetComponent <Statemgr>(); this.renderer = this.GetComponent <MeshRenderer>(); this.originColor = this.renderer.material.color; this.shaking = new Shaking(this.direction, this.AdjustPosition); this.timer = new Timer(); this.timer.Enter(1, this.TickAI); this.collider = this.GetComponent <Collider>(); this.collider.CollisionEnterEvent += this.OnCollide; this.dragging = new Dragging(this.collider); this.dragging.OnDragEvent += this.OnDrag; this.position = this.transform.localPosition; this.scale = this.transform.localScale; this.ResetEvent += this.ResetPostion; this.AITickEvent += this.FollowBall; }
public State(GameObject gameObject, Data data) { this.gameObject = gameObject; this.statemgr = this.gameObject.GetComponent <Statemgr>(); }