コード例 #1
0
ファイル: Player.cs プロジェクト: maoweiming/Game
        void Awake()
        {
            // 出生后一些创建代码
            MyRepresent = gameObject.AddComponent <Represent>();
            MyState     = gameObject.AddMissingComponent <PlayerState>();

            DiariesCount = 0;

            IsDead         = false;
            OnTheClimbAera = false;

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