Exemplo n.º 1
0
 public void UpdateNumTargets(int a_numTargets)
 {
     m_delay.Initialise(a_numTargets);
     m_offsetTime.Initialise(a_numTargets);
     m_volume.Initialise(a_numTargets);
     m_pitch.Initialise(a_numTargets);
 }
        private bool InitialiseVariableStates(GameObject[] a_targetObjects, bool a_onlyMasterValues)
        {
            m_targetTransforms = new RectTransform[a_targetObjects.Length];

            if (a_targetObjects.Length == 0)
            {
                return(false);
            }

            m_pulseScale.Initialise(a_targetObjects.Length);
            m_rotationAngle.Initialise(a_targetObjects.Length);

            RectTransform targetTransform;

            m_masterScales    = new Vector3[a_targetObjects.Length];
            m_masterRotations = new Vector3[a_targetObjects.Length];

            for (int idx = 0; idx < a_targetObjects.Length; idx++)
            {
                if (a_targetObjects [idx] == null)
                {
                    continue;
                }

                targetTransform = a_targetObjects [idx].GetComponent <RectTransform> ();

                m_targetTransforms [idx] = targetTransform;

                m_masterScales [idx]   = targetTransform.localScale;
                m_masterRotations[idx] = targetTransform.localRotation.eulerAngles;
            }

            return(true);
        }
Exemplo n.º 3
0
        private bool InitialiseVariableStates(GameObject[] a_targetObjects, bool a_onlyMasterValues)
        {
            m_targetTransforms = new RectTransform[a_targetObjects.Length];

            if (a_targetObjects.Length == 0)
            {
                return(false);
            }

            m_shakeAmount.Initialise(a_targetObjects.Length);

            RectTransform targetTransform;

            m_masterPositions = new Vector2[a_targetObjects.Length];

            for (int idx = 0; idx < a_targetObjects.Length; idx++)
            {
                if (a_targetObjects [idx] == null)
                {
                    continue;
                }

                targetTransform = a_targetObjects [idx].GetComponent <RectTransform> ();

                m_targetTransforms [idx] = targetTransform;

                m_masterPositions[idx] = new Vector2(targetTransform.anchoredPosition.x, targetTransform.anchoredPosition.y);
            }

            return(true);
        }
        private void InitBaseVariables(int a_numTargets)
        {
            m_delay.Initialise(a_numTargets);
            m_duration.Initialise(a_numTargets);

            if (m_audioClipDatas != null)
            {
                // Make sure to initialise all audioClipData's with latest numTargets
                for (int idx = 0; idx < m_audioClipDatas.Length; idx++)
                {
                    m_audioClipDatas [idx].UpdateNumTargets(a_numTargets);
                }
            }
        }