示例#1
0
        protected void Awake()
        {
            if (cldr == null)
            {
                Debug.Log("Add a collider", this);
            }

            if (damageable == null)
            {
                damageable = GetComponent <Damageable>();
            }

            if (damager == null)
            {
                damager = GetComponent <Damager>();
            }

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

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

            if (rb == null)
            {
                rb = GetComponent <Rigidbody2D>();
            }


            initialPos = this.transform.localPosition;
        }
示例#2
0
 private void Awake()
 {
     if (component == null)
     {
         component = GetComponent <ObstacleComponent>();
         Debug.Log("Forgot to reference");
     }
 }
示例#3
0
文件: Coin.cs 项目: brnpham5/Pet-Game
        private void Awake()
        {
            if (component == null)
            {
                component = GetComponent <ObstacleComponent>();
                Debug.Log("Forgot to reference", this);
            }

            if (pickuppable == null)
            {
                pickuppable = GetComponent <Pickuppable>();
                Debug.Log("Forgot to reference", this);
            }
        }
示例#4
0
        private void Awake()
        {
            if (obstComp == null)
            {
                obstComp = GetComponent <ObstacleComponent>();
            }

            if (triggerable == null)
            {
                triggerable = GetComponent <Triggerable>();
            }

            obstComp.OnSetup += Setup;

            Setup();
        }
示例#5
0
        protected virtual void Awake()
        {
            if (obstComp == null)
            {
                obstComp = GetComponent <ObstacleComponent>();
            }

            if (bumpTrigger == null)
            {
                bumpTrigger = GetComponent <TagTrigger>();
            }

            obstComp.OnSetup += Setup;
            isActive          = true;
            anim.SetBool("IsActive", true);
        }
示例#6
0
        private void Awake()
        {
            if (!gameObject.tag.Equals(Meta_Tags.interactable))
            {
                gameObject.tag = Meta_Tags.interactable;
                Debug.Log("Forgot to tag", this);
            }

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

            component.OnSetup += Setup;
        }
示例#7
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);
            }
        }
示例#8
0
        private void Awake()
        {
            if (component == null)
            {
                component = GetComponent <ObstacleComponent>();
                Debug.Log("Forgot to reference", this);
            }

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

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

            component.OnSetup += Setup;
        }
示例#9
0
        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;
        }