示例#1
0
        public void AddArrowEffect(bool visible, PylonEle fromPylonEle)
        {
            if (m_ArrowEffect == null)
            {
                m_ArrowEffect = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Eletower_02_zhiyin).GetComponent <RepreatEffect>();
            }
            if (visible)
            {
                int index = fromPylonEle.GetIndex();
                if (index == m_PylonEles.Length - 1)
                {
                    m_Symbol = -1;
                }
                else if (index == 0)
                {
                    m_Symbol = 1;
                }
                int      nextIndex  = index + m_Symbol;
                PylonEle toPylonEle = m_PylonEles[nextIndex];

                Vector3 dtVec3 = toPylonEle.transform.position - fromPylonEle.transform.position;
                float   angleZ = EZMath.SignedAngleBetween(dtVec3, Vector3.up);
                m_ArrowEffect.transform.localEulerAngles = new Vector3(0, 0, angleZ + 90);
                m_ArrowEffect.transform.position         = fromPylonEle.transform.position + dtVec3 / 2;
                float length = dtVec3.magnitude;
                m_ArrowEffect.transform.localScale = new Vector3(length, 1, 1);
                m_ArrowEffect.SetLength(length);
            }
            m_ArrowEffect.gameObject.SetActive(visible);
        }
示例#2
0
        public void ActiveWall(PylonEle pylonEle)
        {
            pylonEle.SetPylonState(PylonState.Active);
            int index = pylonEle.GetIndex();

            if (index == m_PylonEles.Length - 1)
            {
                m_Symbol = -1;
            }
            else if (index == 0)
            {
                m_Symbol = 1;
            }
            int      nextIndex  = index + m_Symbol;
            PylonEle toPylonEle = m_PylonEles[nextIndex];

            AddWallImp(pylonEle, toPylonEle);
        }
示例#3
0
        public void DestroyWall(PylonEle pylonEle)
        {
            pylonEle.SetPylonState(PylonState.Frozen);
            int index = pylonEle.GetIndex();

            if (index == m_PylonEles.Length - 1)
            {
                m_Symbol = -1;
            }
            else if (index == 0)
            {
                m_Symbol = 1;
            }
            int      nextIndex  = index + m_Symbol;
            PylonEle toPylonEle = m_PylonEles[nextIndex];

            toPylonEle.SetPylonState(PylonState.CountDown);
            if (m_CurWall != null)
            {
                m_CurWall.gameObject.SetActive(false);
            }
        }