Example #1
0
        private IEnumerator PlayBegin()
        {
            m_Animation.Play("Cam_SPE_Start");
            Single length = m_Animation["Cam_SPE_Start"].length;

            yield return(new WaitForSeconds(length));

            GameObject view = ViewManager.Instance.FindView(45);

            if (view != null)
            {
                AnimatorControl anim = view.GetComponentInChildren <AnimatorControl>();
                if (anim != null)
                {
                    anim.EventSummon(anim.EventMaxValue);
                }
                else
                {
                    Debug.LogError("not found sunrider anim view " + 45);
                }
            }
            else
            {
                Debug.LogError("not found sunrider " + 45);
            }
            IngameController.Instance.EnableGuiCamera(true, true);
            IngameController.Instance.EnableGui(true, true);
            yield break;
        }
        public void SpawnObject()
        {
            Monster monster   = (Monster)MyController;
            Int32   spawnAnim = monster.SpawnAnim;

            if (spawnAnim > 0)
            {
                Renderer[] componentsInChildren = GetComponentsInChildren <Renderer>();
                foreach (Renderer renderer in componentsInChildren)
                {
                    renderer.enabled = false;
                }
                m_AnimatorControl.EventSummon(spawnAnim);
                if (m_SummonEffects)
                {
                    GameObject gameObject = m_effect[spawnAnim - 1];
                    Vector3    b          = Matrix4x4.TRS(Vector3.zero, transform.rotation, transform.localScale).MultiplyVector(m_spawnEffectOffset[spawnAnim - 1]);
                    transform.localPosition = transform.localPosition + b;
                    gameObject = Helper.Instantiate <GameObject>(gameObject, transform.position);
                    gameObject.transform.rotation = transform.rotation;
                    if (gameObject.particleSystem != null)
                    {
                        gameObject.particleSystem.Play();
                    }
                }
                else
                {
                    Debug.Log("No Effect attached");
                }
            }
        }
Example #3
0
        private void Update()
        {
            Transform transform = FXMainCamera.Instance.CurrentCamera.transform;

            transform.localPosition = Vector3.Lerp(transform.localPosition, Vector3.zero, Time.deltaTime * 4f);
            transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.identity, Time.deltaTime * 4f);
            if (!m_barkTriggered && m_CameraMover.Timer >= m_TiggerBark)
            {
                m_barkTriggered = true;
                GameObject gameObject = ViewManager.Instance.FindView(m_MamushiSpawnerID);
                if (gameObject != null)
                {
                    AnimatorControl componentInChildren = gameObject.GetComponentInChildren <AnimatorControl>();
                    if (componentInChildren != null)
                    {
                        componentInChildren.EventSummon(3);
                        if (!String.IsNullOrEmpty(m_SoundKeyBark))
                        {
                            AudioManager.Instance.RequestPlayAudioID(m_SoundKeyBark, 0, -1f, gameObject.transform, 1f, 0f, 0f, null);
                        }
                    }
                    else
                    {
                        Debug.LogError("not found mamushi anim view " + m_MamushiSpawnerID);
                    }
                }
                else
                {
                    Debug.LogError("not found mamushi " + m_MamushiSpawnerID);
                }
            }
            if (!m_titleTriggered && m_CameraMover.Timer >= m_TiggerTitleLabel)
            {
                m_titleTriggered = true;
                m_TitleLabel.Show();
            }
            if (!m_finishTriggered && m_CameraMover.Timer >= 1f)
            {
                m_finishTriggered = true;
                StartCoroutine(StopCutscene(1f));
            }
        }
        protected override void Update()
        {
            base.Update();
            Monster monster = MyController as Monster;

            if (monster != null)
            {
                m_animatorControl.InCombat = monster.IsAggro;
                if (monster.IsAggro)
                {
                    if (!m_InitAggroAnim && ConfigManager.Instance.Options.MonsterMovementSpeed == 1f)
                    {
                        m_InitAggroAnim = true;
                        m_animatorControl.EventSummon(2);
                    }
                }
                else
                {
                    m_InitAggroAnim = false;
                }
            }
        }
 private void StartAnimation()
 {
     m_AnimatorControl.EventSummon(3);
 }
Example #6
0
 private void DrawWindow(Int32 id)
 {
     Time.timeScale = timescale;
     Application.targetFrameRate = targetframerate;
     if (m_Anim != null)
     {
         Int32 attackMagicMaxValue         = m_Anim.AttackMagicMaxValue;
         Int32 attackMeleeMaxValue         = m_Anim.AttackMeleeMaxValue;
         Int32 attackRangedMaxValue        = m_Anim.AttackRangedMaxValue;
         Int32 attackCriticalMeleeMaxValue = m_Anim.AttackCriticalMeleeMaxValue;
         Int32 idleMaxValue  = m_Anim.IdleMaxValue;
         Int32 evadeMaxValue = m_Anim.EvadeMaxValue;
         Int32 blockMaxValue = m_Anim.BlockMaxValue;
         Int32 hitMaxValue   = m_Anim.HitMaxValue;
         Int32 dieMaxValue   = m_Anim.DieMaxValue;
         Int32 eventMaxValue = m_Anim.EventMaxValue;
         m_Anim.InCombat = GUILayout.Toggle(m_Anim.InCombat, "InCombat", new GUILayoutOption[0]);
         GUILayout.Label("Attack Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 i = 1; i <= attackMeleeMaxValue; i++)
         {
             if (GUILayout.Button("#" + i, new GUILayoutOption[0]))
             {
                 m_Anim.Attack(i);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("AttackCritical Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 j = 1; j <= attackCriticalMeleeMaxValue; j++)
         {
             if (GUILayout.Button("#" + j, new GUILayoutOption[0]))
             {
                 m_Anim.AttackCritical(j);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("RangedAttack Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 k = 1; k <= attackRangedMaxValue; k++)
         {
             if (GUILayout.Button("#" + k, new GUILayoutOption[0]))
             {
                 m_Anim.AttackRange(k);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Idle Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 l = 1; l <= idleMaxValue; l++)
         {
             if (GUILayout.Button("#" + l, new GUILayoutOption[0]))
             {
                 m_Anim.IdleSpecial(l);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Evade Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 m = 1; m <= evadeMaxValue; m++)
         {
             if (GUILayout.Button("#" + m, new GUILayoutOption[0]))
             {
                 m_Anim.Evade(m);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Hit Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 n = 1; n <= hitMaxValue; n++)
         {
             if (GUILayout.Button("#" + n, new GUILayoutOption[0]))
             {
                 m_Anim.Hit(n);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Event Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num = 2; num <= eventMaxValue; num++)
         {
             if (GUILayout.Button("#" + (num - 1), new GUILayoutOption[0]))
             {
                 m_Anim.EventSummon(num);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Block Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num2 = 1; num2 <= blockMaxValue; num2++)
         {
             if (GUILayout.Button("#" + num2, new GUILayoutOption[0]))
             {
                 m_Anim.Block(num2);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("MagicAttackAnimations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num3 = 1; num3 <= attackMagicMaxValue; num3++)
         {
             if (GUILayout.Button("#" + num3, new GUILayoutOption[0]))
             {
                 m_Anim.AttackMagic(num3);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Die Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num4 = 1; num4 <= dieMaxValue; num4++)
         {
             if (GUILayout.Button("#" + num4, new GUILayoutOption[0]))
             {
                 m_Anim.Die(num4);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Movement/Turn Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         if (GUILayout.Button("StartPosition", new GUILayoutOption[0]))
         {
             Quaternion lookDirection = Quaternion.Euler(0f, 0f, 0f);
             Vector3    position      = new Vector3(0f, 0f, 0f);
             m_Anim.MoveTo(position, lookDirection);
         }
         if (GUILayout.Button("LeftPosition", new GUILayoutOption[0]))
         {
             Vector3 position2 = new Vector3(20f, 0f, 0f);
             m_Anim.MoveTo(position2, transform.rotation);
         }
         if (GUILayout.Button("RightPosition", new GUILayoutOption[0]))
         {
             Vector3 position3 = new Vector3(-10f, 0f, 0f);
             m_Anim.MoveTo(position3, transform.rotation);
         }
         if (GUILayout.Button("BackPosition", new GUILayoutOption[0]))
         {
             Vector3 position4 = new Vector3(0f, 0f, -10f);
             m_Anim.MoveTo(position4, transform.rotation);
         }
         GUILayout.EndHorizontal();
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         if (GUILayout.Button("Rotate Left", new GUILayoutOption[0]))
         {
             m_MonsterRotation = transform.rotation;
             m_Degree          = RotationValueHandler(-90f);
             m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f);
             m_Anim.RotateTo(m_MonsterRotation);
         }
         if (GUILayout.Button("Rotate Right", new GUILayoutOption[0]))
         {
             m_MonsterRotation = transform.rotation;
             m_Degree          = RotationValueHandler(90f);
             m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f);
             m_Anim.RotateTo(m_MonsterRotation);
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("IsMoving: " + m_Anim.IsMoving, new GUILayoutOption[0]);
         GUILayout.Label("IsRotating: " + m_Anim.IsRotating, new GUILayoutOption[0]);
         GUILayout.Label("InMovement: " + m_Anim.InMovement, new GUILayoutOption[0]);
         GUILayout.Label("IsDead: " + m_Anim.IsDead, new GUILayoutOption[0]);
         GUILayout.Label("InCombat: " + m_Anim.InCombat, new GUILayoutOption[0]);
     }
 }
Example #7
0
 private void TabMonsterAnimation()
 {
     if (m_Main.ActiveMonsterAnimationHandler != null)
     {
         Int32 attackMagicMaxValue         = m_Anim.AttackMagicMaxValue;
         Int32 attackMeleeMaxValue         = m_Anim.AttackMeleeMaxValue;
         Int32 attackRangedMaxValue        = m_Anim.AttackRangedMaxValue;
         Int32 attackCriticalMeleeMaxValue = m_Anim.AttackCriticalMeleeMaxValue;
         Int32 idleMaxValue  = m_Anim.IdleMaxValue;
         Int32 evadeMaxValue = m_Anim.EvadeMaxValue;
         Int32 blockMaxValue = m_Anim.BlockMaxValue;
         Int32 hitMaxValue   = m_Anim.HitMaxValue;
         Int32 dieMaxValue   = m_Anim.DieMaxValue;
         Int32 eventMaxValue = m_Anim.EventMaxValue;
         m_IdleRota = GUILayout.Toggle(m_IdleRota, "Switch On/Off Idle Rota", new GUILayoutOption[0]);
         if (!m_IdleRota)
         {
             m_Main.ActiveMonsterView.NumberOfIdleAnimations = 0;
         }
         else
         {
             m_Main.ActiveMonsterView.NumberOfIdleAnimations = idleMaxValue;
         }
         m_Anim.InCombat = GUILayout.Toggle(m_Anim.InCombat, "InCombat", new GUILayoutOption[0]);
         GUILayout.Label("Attack Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 i = 1; i <= attackMeleeMaxValue; i++)
         {
             if (GUILayout.Button("#" + i, new GUILayoutOption[0]))
             {
                 m_Anim.Attack(i);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("AttackCritical Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 j = 1; j <= attackCriticalMeleeMaxValue; j++)
         {
             if (GUILayout.Button("#" + j, new GUILayoutOption[0]))
             {
                 m_Anim.AttackCritical(j);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("RangedAttack Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 k = 1; k <= attackRangedMaxValue; k++)
         {
             if (GUILayout.Button("#" + k, new GUILayoutOption[0]))
             {
                 m_Anim.AttackRange(k);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Idle Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 l = 1; l <= idleMaxValue; l++)
         {
             if (GUILayout.Button("#" + l, new GUILayoutOption[0]))
             {
                 m_Anim.IdleSpecial(l);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Evade Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 m = 1; m <= evadeMaxValue; m++)
         {
             if (GUILayout.Button("#" + m, new GUILayoutOption[0]))
             {
                 m_Anim.Evade(m);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Hit Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 n = 1; n <= hitMaxValue; n++)
         {
             if (GUILayout.Button("#" + n, new GUILayoutOption[0]))
             {
                 m_Anim.Hit(n);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Event Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num = 2; num <= eventMaxValue; num++)
         {
             if (GUILayout.Button("#" + (num - 1), new GUILayoutOption[0]))
             {
                 m_Anim.EventSummon(num);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Block Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num2 = 1; num2 <= blockMaxValue; num2++)
         {
             if (GUILayout.Button("#" + num2, new GUILayoutOption[0]))
             {
                 m_Anim.Block(num2);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("MagicAttackAnimations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num3 = 1; num3 <= attackMagicMaxValue; num3++)
         {
             if (GUILayout.Button("#" + num3, new GUILayoutOption[0]))
             {
                 m_Anim.AttackMagic(num3);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Die Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         for (Int32 num4 = 1; num4 <= dieMaxValue; num4++)
         {
             if (GUILayout.Button("#" + num4, new GUILayoutOption[0]))
             {
                 m_Anim.Die(num4);
             }
         }
         GUILayout.EndHorizontal();
         GUILayout.Label("Movement/Turn Animations:", new GUILayoutOption[0]);
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         if (GUILayout.Button("StartPosition", new GUILayoutOption[0]))
         {
             m_Anim.MoveTo(transform.position, transform.rotation);
         }
         if (GUILayout.Button("LeftPosition", new GUILayoutOption[0]))
         {
             Vector3 position = new Vector3(10f, 0f, 0f);
             m_Anim.MoveTo(position, transform.rotation);
         }
         if (GUILayout.Button("RightPosition", new GUILayoutOption[0]))
         {
             Vector3 position2 = new Vector3(-10f, 0f, 0f);
             m_Anim.MoveTo(position2, transform.rotation);
         }
         if (GUILayout.Button("BackPosition", new GUILayoutOption[0]))
         {
             Vector3 position3 = new Vector3(0f, 0f, -10f);
             m_Anim.MoveTo(position3, transform.rotation);
         }
         GUILayout.EndHorizontal();
         GUILayout.BeginHorizontal(new GUILayoutOption[0]);
         if (GUILayout.Button("Rotate Left", new GUILayoutOption[0]))
         {
             m_MonsterRotation = m_Main.ActiveMonster.transform.rotation;
             m_Degree          = RotationValueHandler(-90f);
             m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f);
             m_Anim.RotateTo(m_MonsterRotation);
         }
         if (GUILayout.Button("Rotate Right", new GUILayoutOption[0]))
         {
             m_MonsterRotation = m_Main.ActiveMonster.transform.rotation;
             m_Degree          = RotationValueHandler(90f);
             m_MonsterRotation = Quaternion.Euler(0f, m_Degree, 0f);
             m_Anim.RotateTo(m_MonsterRotation);
         }
         GUILayout.EndHorizontal();
     }
 }