Beispiel #1
0
        void Awake()
        {
            // 出生后一些创建代码
            MyRepresent = gameObject.AddComponent <Represent>();
            MyState     = gameObject.AddMissingComponent <PlayerState>();

            DiariesCount = 0;

            IsDead         = false;
            OnTheClimbAera = false;

            MyState.Init(this);
        }
Beispiel #2
0
 protected BaseState(Player player)
 {
     Owner     = player;
     Animator  = player.gameObject.GetComponent <Represent>();
     Rigidbody = player.gameObject.GetComponent <Rigidbody2D>();
 }