Exemple #1
0
        //----------------------
        // Protected Variables

        //========================================
        //      setter / getter
        //------------------------------

        //========================================
        //      Unity's function
        //------------------------------
        protected override void Awake()
        {
            base.Awake();

            mTrackAction           = this.GetComponent <JCS_2DTrackAction>();
            mTrackAction.Following = false;


            mGoStraightAction         = this.GetComponent <JCS_3DGoStraightAction>();
            mGoStraightAction.enabled = true;
        }
        /* Functions */

        private void Awake()
        {
            this.mGoStraightAction   = this.GetComponent <JCS_3DGoStraightAction>();
            this.mLookAtAction       = this.GetComponent <JCS_3DLookAtAction>();
            this.mAdjustTimerTrigger = this.GetComponent <JCS_AdjustTimeTrigger>();

            this.mAdjustTimerTrigger.actions = DoPath;

#if UNITY_EDITOR
            if (mPoints.Count == 0)
            {
                JCS_Debug.LogWarning("Path action with 0 path point is not valid");
            }
#endif

            GetNextPoint();
        }
        /* Functions */

        protected override void Awake()
        {
            base.Awake();

            mGoStraightAction = this.GetComponent <JCS_3DGoStraightAction>();

            if (mRandomAbsorbTime != 0)
            {
                mTimeToAbsorb += JCS_Random.Range(-mRandomAbsorbTime, mRandomAbsorbTime);
            }

            if (mInitLookAction == null)
            {
                mInitLookAction = this.GetComponent <JCS_2DInitLookByTypeAction>();
            }

            if (mRandomTimeToLook != 0)
            {
                mTimeToLook += JCS_Random.Range(-mRandomTimeToLook, mRandomTimeToLook);
            }
        }