Example #1
0
 public void Clear()
 {
     try
     {
         this.m_ActionAnis.Clear();
         this.m_aniKeyManager.Clear();
     }
     catch (Exception ex)
     {
         TsLog.LogError("{0}", new object[]
         {
             ex.Message
         });
     }
     finally
     {
         this.m_ActionAnis    = null;
         this.m_aniKeyManager = null;
     }
 }
Example #2
0
 public void Init()
 {
     if (this.m_aniKeyManager == null)
     {
         this.m_aniKeyManager = new AniKeyPairManager();
     }
     if (this.m_Camera == null)
     {
         for (int i = 0; i < Camera.allCamerasCount; i++)
         {
             if (Camera.allCameras[i] != null && Camera.allCameras[i].name.Contains("Main"))
             {
                 this.m_Camera = Camera.allCameras[i];
                 break;
             }
         }
     }
     if (this.m_ActionAnis == null)
     {
         this.m_ActionAnis = new Dictionary <string, Animation>();
     }
     if (this.m_PlayAniQue == null)
     {
         this.m_PlayAniQue = new Queue <AniKeyPair>();
     }
     if (this.m_ActionAnis.Count == 0)
     {
         GameObject gameObject = GameObject.Find("fx_charactercreate");
         if (gameObject == null)
         {
             return;
         }
         if (Screen.width == 1024)
         {
             gameObject.transform.localPosition = new Vector3(-0.2f, 0f, 0f);
             gameObject.transform.localScale    = new Vector3(0.88f, 1f, 1f);
             Transform transform = gameObject.transform.FindChild("humanf");
             if (null != transform)
             {
                 transform.transform.localPosition = new Vector3(-28f, -41f, 0f);
             }
         }
         else if (Screen.width == 960)
         {
             gameObject.transform.localPosition = new Vector3(-0.2f, 0f, 0f);
             gameObject.transform.localScale    = new Vector3(0.88f, 1f, 1f);
             Transform transform2 = gameObject.transform.FindChild("humanf");
             if (null != transform2)
             {
                 transform2.transform.localPosition = new Vector3(-28.5f, -41f, 0f);
             }
         }
         Animation[] componentsInChildren = gameObject.GetComponentsInChildren <Animation>();
         if (componentsInChildren == null)
         {
             TsLog.LogError("CCameraAniPlay Animation == null", new object[0]);
             return;
         }
         this.m_IntroVoice = gameObject.GetComponentInChildren <AudioSource>();
         Animation[] array = componentsInChildren;
         for (int j = 0; j < array.Length; j++)
         {
             Animation animation = array[j];
             foreach (AnimationState animationState in animation)
             {
                 if (!(animationState.clip == null))
                 {
                     if (!this.m_ActionAnis.ContainsKey(animationState.clip.name))
                     {
                         this.m_ActionAnis.Add(animationState.clip.name, animation);
                     }
                     else
                     {
                         Debug.LogWarning("Have Ani = " + animationState.clip.name);
                     }
                 }
             }
         }
     }
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.INTRO1, "intro1", "intro");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.INTROTOCREATE, "introtocreate", "create");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.CREATETOSELECT, "createtoselect", string.Empty);
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.ELFTOCREATE, "elftocreate", "create");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.FURRYTOCREATE, "furrytocreate", "create");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.HUMANTOCREATE, "humantocreate", "create");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.HUMANFTOCREATE, "humanftocreate", "create");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.CREATETOELF, "createtoelf", "elf_up");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.CREATETOFURRY, "createtofurry", "furry_up");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.CREATETOHUMAN, "createtohumanm", "human_up");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.CREATETOHUMANF, "createtohumanf", "humanf_up");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.CREATETOSELECT, "createtoselect", string.Empty);
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.ELFTOSELECT, "elftoselect", string.Empty);
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.FURRYTOSELECT, "furrytoselect", string.Empty);
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.HUMANTOSELECT, "humantoselect", string.Empty);
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.HUMANFTOSELECT, "humanftoselect", string.Empty);
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.HUMAN_MALETOFEMALE, string.Empty, "human_maletofemale");
     this.m_aniKeyManager.AddData(E_CAMARA_STATE_ANI.HUMAN_FEMALETOMALE, string.Empty, "human_femaletomale");
 }