Example #1
0
        private static void InitOdinGod()
        {
            var podin = ZNetScene.instance.GetPrefab("odin");
            var odin  = Instantiate(podin, Root.transform);
            var ani   = odin.GetComponentInChildren <Animator>();

            DestroyImmediate(odin.GetComponent <ZNetView>());
            DestroyImmediate(odin.GetComponent <ZSyncTransform>());
            DestroyImmediate(odin.GetComponent <Odin>());
            DestroyImmediate(odin.GetComponent <Rigidbody>());
            Aoe[]        aoes = odin.GetComponentsInChildren <Aoe>();
            EffectArea[] fxas = odin.GetComponentsInChildren <EffectArea>();
            foreach (var item in aoes)
            {
                DestroyImmediate(item);
            }
            foreach (var item in fxas)
            {
                DestroyImmediate(item);
            }

            //ani.runtimeAnimatorController=ZNetScene.instance.GetPrefab("Haldor").GetComponentInChildren<Animator>().runtimeAnimatorController;
            //var stf = odin.transform.Find("staff");
            //var hand = odin.transform.Find("RightHand");
            //stf.SetParent(hand);


            m_odinGod = odin.AddComponent <OdinGod>();
            odin.transform.localPosition = new Vector3(0f, 0, 0f);
        }
Example #2
0
 private void OnDestroy()
 {
     //RestTerrian();
     if (m_instance == this)
     {
         m_instance = null;
     }
 }
Example #3
0
 private void Awake()
 {
     m_instance = this;
     Summon();
     m_head   = this.gameObject.transform.Find("visual/Armature/Hips/Spine0/Spine1/Spine2/Head");
     m_name   = "$op_god";
     m_talker = this.gameObject;
     InvokeRepeating("requestOidnPosition", 1, 3);
     DBG.blogInfo("Client start to Calling Request Odin Location");
 }