Пример #1
0
        /// <summary>
        /// Initialize damage text to the array.
        /// </summary>
        private void InitDamageTextToArray()
        {
            mDamageTexts = new JCS_Vector <JCS_DamageText>(mNumberOfHandle);

            if (mDamageText == null)
            {
                return;
            }

            for (int count = 0; count < mNumberOfHandle; ++count)
            {
                // spawn a new game object,
                // and get the component
                JCS_DamageText dt = JCS_Utility.SpawnGameObject(
                    mDamageText,
                    mDamageText.transform.position,
                    mDamageText.transform.rotation) as JCS_DamageText;

                // add to array
                mDamageTexts.set(count, dt);

                // set parent
                dt.transform.SetParent(this.transform);
            }
        }
Пример #2
0
        //========================================
        //      Unity's function
        //------------------------------
        private void Awake()
        {
            this.mLiveObject = this.GetComponent <JCS_2DLiveObject>();

            if (mDetectCollider.Length == 0)
            {
                JCS_Debug.LogReminders(
                    "No Collider assing for dectetion...");
            }


            for (int index = 0;
                 index < mDetectCollider.Length;
                 ++index)
            {
                if (mDetectCollider[index] == null)
                {
                    JCS_Debug.LogReminders(
                        "No Collider assing for dectetion...");

                    continue;
                }

                // let the detect area know his parent class (this)
                JCS_DetectArea da = mDetectCollider[index].gameObject.AddComponent <JCS_DetectArea>();
                da.SetAction(this);

                // force the collider equals to true!!
                mDetectCollider[index].isTrigger = true;
            }

            // create list to manage all detected object
            mDetectedObjects = new JCS_Vector <JCS_DetectAreaObject>();
        }
        //========================================
        //      Unity's function
        //------------------------------
        protected void Awake()
        {
            mTargetList = new JCS_Vector <JCS_Player>();

            mAudioListener = this.GetComponent <AudioListener>();

            // find the camera in the scene first
            mJCS_2DCamera = (JCS_2DCamera)FindObjectOfType(typeof(JCS_2DCamera));

            // if still null spawn a default one!
            if (mJCS_2DCamera == null)
            {
                JCS_Debug.LogError("There is not JCS_2DCamera attach to, spawn a default one!");

                // Spawn a Default one!
                this.mJCS_2DCamera = JCS_Utility.SpawnGameObject(
                    JCS_2DCamera.JCS_2DCAMERA_PATH,
                    transform.position,
                    transform.rotation).GetComponent <JCS_2DCamera>();
            }

            mJCS_2DCamera.SetFollowTarget(this.transform);

            // record down the fild of view
            mTargetFieldOfView = mJCS_2DCamera.fieldOfView;
        }
        /* Setter & Getter */

        /* Functions */

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

            this.mLogTextPool = this.GetComponent <JCS_GUITextPool>();

            mRenderLogText = new JCS_Vector <JCS_LogText>();
        }
Пример #5
0
 /// <summary>
 /// Set the sound mute or not with list needed.
 /// </summary>
 /// <param name="list"> list of the audio source. </param>
 /// <param name="act"> target mute action. </param>
 private void SetSoundtMute(JCS_Vector <AudioSource> list, bool act)
 {
     for (int index = 0;
          index < list.length;
          ++index)
     {
         list.at(index).mute = act;
     }
 }
Пример #6
0
 /// <summary>
 /// Set the sound volume in the list.
 /// </summary>
 /// <param name="list"> list of the audio source </param>
 /// <param name="vol"> target volume. </param>
 private void SetSoundVolume(JCS_Vector <AudioSource> list, float vol)
 {
     for (int index = 0;
          index < list.length;
          ++index)
     {
         list.at(index).volume = vol;
     }
 }
        /* Functions */

        private void Awake()
        {
            mParticles = new JCS_Vector <JCS_Particle>();

            mThread          = new JCS_Vector <int>();
            mTimers          = new JCS_Vector <float>();
            mParticleCount   = new JCS_Vector <int>();
            mParticleCounter = new JCS_Vector <int>();

            mFreezePos = this.transform.position;
        }
Пример #8
0
        /// <summary>
        /// Assgin the audio source to audio source list.
        /// </summary>
        /// <param name="list"> List of audio source. </param>
        /// <param name="sound"> audio source to add into list. </param>
        private void AssignSoundToList(JCS_Vector <AudioSource> list, AudioSource sound)
        {
            if (sound == null)
            {
                JCS_Debug.LogError("Assigning Source that is null...");
                return;
            }

            list.push(sound);
            sound.volume = JCS_SoundSettings.instance.GetSFXSound_Volume();
        }
Пример #9
0
        private void Awake()
        {
            instance = this;

            // try to get component, this is not guarantee.
            this.mJCSFadeSound = this.GetComponent <JCS_FadeSound>();

            mSFXSounds    = new JCS_Vector <AudioSource>();
            mSkillsSounds = new JCS_Vector <AudioSource>();

            mGlobalSoundPlayer = this.GetComponent <JCS_SoundPlayer>();
        }
Пример #10
0
        //========================================
        //      Unity's function
        //------------------------------
        private void Awake()
        {
            this.mAIActions = new JCS_Vector <JCS_AIAction>();

            // add all the ai action into the array.
            JCS_AIAction[] actions = this.GetComponents <JCS_AIAction>();
            for (int index = 0;
                 index < actions.Length;
                 ++index)
            {
                mAIActions.push(actions[index]);
            }
        }
        //========================================
        //      Unity's function
        //------------------------------
        private void Awake()
        {
            mShootAction       = this.GetComponent <JCS_ShootAction>();
            mCursorShootAction = this.GetComponent <JCS_2DCursorShootAction>();

            // overwrite both shoot action,
            // so they won't process the input.
            mShootAction.OverrideShoot       = true;
            mCursorShootAction.OverrideShoot = true;

            mThread       = new JCS_Vector <int>();
            mTimers       = new JCS_Vector <float>();
            mShootCount   = new JCS_Vector <int>();
            mShootCounter = new JCS_Vector <int>();
            mShootPos     = new JCS_Vector <Vector3>();
            mShootAngles  = new JCS_Vector <Vector3>();
        }
Пример #12
0
        //========================================
        //      Unity's function
        //------------------------------
        private void Awake()
        {
            mShootAction = this.GetComponent <JCS_ShootAction>();

            // override the shoot effect in the base one.
            mShootAction.OverrideShoot = true;

            mThread             = new JCS_Vector <int>();
            mTimers             = new JCS_Vector <float>();
            mShootCount         = new JCS_Vector <int>();
            mShootCounter       = new JCS_Vector <int>();
            mShootPos           = new JCS_Vector <Vector3>();
            mTargetsPerSequence = new JCS_Vector <Transform>();
            mShootDirection     = new JCS_Vector <bool>();

            // try to get the ability format.
            if (mAbilityFormat == null)
            {
                mAbilityFormat = this.GetComponent <JCS_AbilityFormat>();
            }
        }
Пример #13
0
        //========================================
        //      Self-Define
        //------------------------------
        //----------------------
        // Public Functions

        //----------------------
        // Protected Functions

        //----------------------
        // Private Functions

        /// <summary>
        /// Spawn the text pool base on number of handle.
        /// </summary>
        private void SpawnTextPool()
        {
            if (mLogText == null)
            {
                JCS_Debug.LogReminders(
                    "No log text assign in the text pool...");

                return;
            }


            // NOTE(JenChieh): this might change in
            // the future.
            // Get the log system from the
            // same transfrom/node.
            JCS_IGLogSystem logSystem = this.GetComponent <JCS_IGLogSystem>();


            mLogTexts = new JCS_Vector <JCS_LogText>(mNumberOfHandle);

            for (int count = 0;
                 count < mNumberOfHandle;
                 ++count)
            {
                // spawn a new game object,
                // and get the component
                JCS_LogText logText = (JCS_LogText)JCS_Utility.SpawnGameObject(mLogText);

                // add to array
                mLogTexts.set(count, logText);

                // set parent
                JCS_Utility.SetParentWithoutLosingInfo(logText.transform, this.transform);

                // NOTE(JenChieh): this might change in
                // the future.
                // set the log system if there is one.
                logText.SetIGLogSystem(logSystem);
            }
        }
Пример #14
0
        /* Functions */

        private void Awake()
        {
            mAttackers = new JCS_Vector <Transform>();
        }
Пример #15
0
 public JCS_Pool(int num)
 {
     objects = new JCS_Vector <T>(num);
 }