void Awake() { // 出生后一些创建代码 MyRepresent = gameObject.AddComponent <Represent>(); MyState = gameObject.AddMissingComponent <PlayerState>(); DiariesCount = 0; IsDead = false; OnTheClimbAera = false; MyState.Init(this); }
protected BaseState(Player player) { Owner = player; Animator = player.gameObject.GetComponent <Represent>(); Rigidbody = player.gameObject.GetComponent <Rigidbody2D>(); }