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); }
private void AddWallImp(PylonEle fromPylonEle, PylonEle toPylonEle) { //m_CurWall if (m_CurWall == null) { m_CurWall = Global.gApp.gResMgr.InstantiateObj(EffectConfig.PylonWallEffect).transform; } Vector3 dtVec3 = toPylonEle.transform.position - fromPylonEle.transform.position; float angleZ = EZMath.SignedAngleBetween(dtVec3, Vector3.up); m_CurWall.localEulerAngles = new Vector3(0, 0, angleZ + 90); m_CurWall.position = fromPylonEle.transform.position + dtVec3 / 2; m_CurWall.localScale = new Vector3(dtVec3.magnitude / 6.45f, 1, 1); m_CurWall.gameObject.SetActive(true); }
public void AddChargingStepEffect(PylonEle pylonEle, int step) { int createCount = step - m_StepEffect.Count; if (createCount > 0) { for (int i = 0; i < createCount; i++) { m_StepEffect.Add(Global.gApp.gResMgr.InstantiateObj(EffectConfig.Eletower_02_quan)); } } m_StepEffect[step - 1].gameObject.SetActive(true); Vector3 pylonElePos = pylonEle.transform.position; pylonElePos.z = m_StartPos + m_StepDis * (step - 1); m_StepEffect[step - 1].transform.position = pylonElePos; }
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); }
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); } }