Esempio n. 1
0
        private IEnumerator Animate()
        {
            _animationPlayedOnce = true;
            var lines = GetComponentsInChildren <MAIAHologramLineAnimation>();
            var heads = GetComponentsInChildren <MAIAHologramHeadAnimation>();

            foreach (var line in lines)
            {
                line.Clear();
            }
            foreach (var head in heads)
            {
                head.Clear();
            }
            var spark1 = Instantiate(_sparkPrefab, transform);

            spark1.Init(_start1.transform, transform);
            var spark2 = Instantiate(_sparkPrefab, transform);

            spark2.Init(_start2, transform);
            yield return(new WaitForSeconds(_sparkPrefab.duration));

            foreach (var line in lines)
            {
                line.StartAnimation();
            }
            yield return(new WaitForSeconds(_lineRendererPrefab.GetComponent <MAIAHologramLineAnimation>().explosionDuration * 0.7f));

            foreach (var head in heads)
            {
                head.StartAnimation();
            }
        }
Esempio n. 2
0
        void Awake()
        {
            m_RayMaterial            = MaterialUtils.GetMaterialClone(m_LineRenderer.GetComponent <MeshRenderer>());
            m_ConeTransform          = m_Cone.transform;
            m_OriginalConeLocalScale = m_ConeTransform.localScale;

            rayVisible  = true;
            coneVisible = true;
        }