コード例 #1
0
ファイル: Stompable.cs プロジェクト: brnpham5/Pet-Game
        private void Awake()
        {
            if (damageable == null)
            {
                damageable = GetComponent <Damageable>();
            }

            if (pusher == null)
            {
                pusher = GetComponent <Pusher>();
            }
        }
コード例 #2
0
        private void Awake()
        {
            if (component == null)
            {
                component = GetComponent <ObstacleComponent>();
                Debug.Log("Forgot to reference", this);
            }

            if (damager == null)
            {
                damager = GetComponent <Damager>();
                Debug.Log("Forgot to reference", this);
            }

            if (pusher == null)
            {
                pusher = GetComponent <Pusher>();
                Debug.Log("Forgot to reference", this);
            }
        }
コード例 #3
0
ファイル: Kickable.cs プロジェクト: brnpham5/Pet-Game
        private void Awake()
        {
            if (damageable == null)
            {
                damageable = GetComponent <Damageable>();
            }

            if (movable == null)
            {
                movable = GetComponent <Movable>();
            }

            if (obstComp == null)
            {
                obstComp = GetComponent <ObstacleComponent>();
            }

            if (pusher == null)
            {
                pusher = GetComponent <Pusher>();
            }

            obstComp.OnSetup += Setup;
        }