public void Init() { if (_hasInited) { return; } m_circleTrans = transform; m_arrowTrans = m_circleTrans.FindChild(m_arrowObjectName); if (m_arrowTrans != null) { m_arrowTrans.parent = null; } Transform rotatedObjTrans = m_circleTrans.FindChild(m_rotatedCircleName); if (rotatedObjTrans != null) { Quaternion.Euler(90, 360, 0); EffectObjRotatedY.AddToObj(rotatedObjTrans.gameObject, 180); } if (LoadDestEffect()) { HideDestEffect(); } if (LoadArrowEffect()) { HideArrawEffect(); } arrowAnims = new ArrowAnim[8]; arrowAnims[0] = new ArrowAnim(); arrowAnims[0].idx = 0; arrowAnims[0].timer = .21875f; arrowAnims[1] = new ArrowAnim(); arrowAnims[1].idx = 1; arrowAnims[1].timer = .1875f; arrowAnims[2] = new ArrowAnim(); arrowAnims[2].idx = 2; arrowAnims[2].timer = .15625f; arrowAnims[3] = new ArrowAnim(); arrowAnims[3].idx = 3; arrowAnims[3].timer = .125f; arrowAnims[4] = new ArrowAnim(); arrowAnims[4].idx = 4; arrowAnims[4].timer = .09375f; arrowAnims[5] = new ArrowAnim(); arrowAnims[5].idx = 5; arrowAnims[5].timer = .0625f; arrowAnims[6] = new ArrowAnim(); arrowAnims[6].idx = 6; arrowAnims[6].timer = .03125f; arrowAnims[7] = new ArrowAnim(); arrowAnims[7].idx = 7; arrowAnims[7].timer = 0f; m_bHasDestination = false; m_Destination = new AutoSearchPoint(); m_Path = new AutoSearchPath(); m_NavPath = new NavMeshPath(); _hasInited = true; }
public static EffectObjRotatedY AddToObj(GameObject go, float speed) { if (go == null) { return(null); } EffectObjRotatedY com = go.GetComponent <EffectObjRotatedY>(); if (com == null) { com = go.AddComponent <EffectObjRotatedY>(); } com.m_rotatedSpeed = speed; com.enabled = true; com.m_startEulerAngles = com.transform.localEulerAngles; return(com); }