Example #1
0
 protected override void Awake()
 {
     if (GetComponentInChildren <AnimEventHandler>() != null)
     {
         base.Awake();
         if (m_Animation == null)
         {
             m_Animation = this.GetComponentInChildren <AnimHandler>(true);
         }
         if (m_AnimationEvents == null)
         {
             m_AnimationEvents = this.GetComponentInChildren <AnimEventHandler>(true);
         }
         m_old = true;
     }
     else
     {
         base.Awake();
         if (m_animator == null)
         {
             m_animator = this.GetComponentInChildren <Animator>(true);
         }
         if (m_animatorControl == null)
         {
             m_animatorControl = this.GetComponentInChildren <AnimatorControl>(true);
         }
         if (m_eventHandler == null)
         {
             m_eventHandler = this.GetComponentInChildren <BaseEventHandler>(true);
         }
         m_animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
     }
 }
Example #2
0
    private void DrawAnimatorControl(AnimatorControl control)
    {
        EditorGroup.Horizontal(() => control.ignoreUi = EditorGUILayout.Toggle("ignoreUi", control.ignoreUi));
        EditorGroup.Horizontal(() =>
        {
            control.useInputButton = EditorGUILayout.Toggle("useInputButton", control.useInputButton);
            if (control.useInputButton == false)
            {
                return;
            }
            control.inputButton =
                (PointerEventData.InputButton)EditorGUILayout.Popup((int)control.inputButton, _buttonList);
        });
        EditorGroup.Horizontal(() =>
        {
            EditorGUILayout.LabelField($"Reverse mode", EditorStyles.label, GUILayout.MaxWidth(100));
            var popup = (AnimationModes)EditorGUILayout.Popup((int)control.mode, _modeList);
            if (popup == control.mode)
            {
                return;
            }
            control.mode = popup;
            control.ModeChanged();
        });

        if (GUILayout.Button("UpdateAllParameters"))
        {
            foreach (var systemAnimator in control.animatorSystems)
            {
                systemAnimator.UpdateParameters();
            }
        }
    }
Example #3
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;
        }
Example #4
0
    private void Window(Int32 id)
    {
        CheckStyles();
        m_TabIndex = GUILayout.SelectionGrid(m_TabIndex, m_Tabs, m_Tabs.Length, (GUILayoutOption[])null);
        switch (m_TabIndex)
        {
        case 0:
            TabPartySpell();
            break;

        case 1:
            TabMonster();
            break;

        case 2:
            m_Anim = m_Main.ActiveMonsterAnimationHandler;
            TabMonsterAnimation();
            break;

        case 3:
            TabMonsterSpell();
            break;
        }
        GUI.DragWindow();
    }
        private IEnumerator FollowPath()
        {
            Int32 idx = 0;

            if (m_MarkusWolfView == null)
            {
                m_MarkusWolfView = ViewManager.Instance.FindView(m_MarkusWolfSpawnerID);
            }
            if (m_MarkusWolfView != null)
            {
                AnimatorControl animControl = m_MarkusWolfView.GetComponentInChildren <AnimatorControl>();
                animControl.AttackMagic(3);
                while (idx < m_MarkusMovePoints.Length)
                {
                    Vector3    targetPos = transform.TransformPoint(m_MarkusMovePoints[idx].Position);
                    Quaternion targetDir = Quaternion.Euler(m_MarkusMovePoints[idx].LookDirection);
                    animControl.MoveTo(targetPos, targetDir);
                    if (2f >= Vector3.Distance(targetPos, m_MarkusWolfView.transform.position))
                    {
                        idx++;
                    }
                    else
                    {
                        yield return(null);
                    }
                }
            }
            Monster entity = LegacyLogic.Instance.WorldManager.FindObject(m_MarkusWolfSpawnerID) as Monster;

            if (entity != null)
            {
                entity.Move(new Position(m_MarkusWolfMoveToX, m_MarkusWolfMoveToY), m_MarkusWolfLooAt, false);
            }
            yield break;
        }
Example #6
0
    private IEnumerator LoadMonster(String p_PrefabName)
    {
        AssetBundleManager manager = GetComponent <AssetBundleManager>();
        AssetRequest       request = manager.RequestAsset(p_PrefabName);

        if (request == null)
        {
            Debug.Log("unknow path " + p_PrefabName);
            yield break;
        }
        if (request == null || request.Status == ERequestStatus.Error)
        {
            Debug.Log(request.ErrorText);
            yield break;
        }
        yield return(StartCoroutine(request));

        GameObject asset = (GameObject)request.Asset;

        m_ActiveMonster                    = (GameObject)Instantiate(asset);
        m_ActiveMonsterView                = m_ActiveMonster.GetComponent <LevelEntityView>();
        m_ActiveMonsterCombatView          = m_ActiveMonster.GetComponent <LevelEntityCombatView>();
        m_ActiveMonsterSpellView           = m_ActiveMonster.GetComponent <LevelEntitySpellView>();
        m_ActiveMonsterAnimationHandler    = m_ActiveMonster.GetComponentInChildren <AnimatorControl>();
        m_ActiveMonster.transform.position = default(Vector3);
        m_ActiveMonster.transform.rotation = Quaternion.identity;
        yield break;
    }
 protected override void Awake()
 {
     base.Awake();
     m_EventHash       = Animator.StringToHash("EVENT");
     m_AnimatorControl = GetComponentInChildren <AnimatorControl>();
     m_Animator        = GetComponentInChildren <Animator>();
 }
 private void ToggleSkinRenderers(AnimatorControl p_model)
 {
     SkinnedMeshRenderer[] componentsInChildren = p_model.GetComponentsInChildren <SkinnedMeshRenderer>(true);
     foreach (SkinnedMeshRenderer skinnedMeshRenderer in componentsInChildren)
     {
         skinnedMeshRenderer.enabled = !skinnedMeshRenderer.enabled;
     }
 }
 private void AddParticleFX(AnimatorControl p_model)
 {
     SkinnedMeshRenderer[] componentsInChildren = p_model.GetComponentsInChildren <SkinnedMeshRenderer>();
     foreach (SkinnedMeshRenderer p_renderer in componentsInChildren)
     {
         ParticalizeRenderer(p_renderer);
     }
 }
Example #10
0
 // Use this for initialization
 void Awake()
 {
     myAnim      = this.GetComponent <AnimatorControl>();
     camAnim     = Camera.main.GetComponent <Animator>();
     myMovement  = this.GetComponent <UnitMovement>();
     tCam        = this.GetComponentInChildren <ThirdCamera>();
     myUnitState = this.GetComponent <UnitState>();
 }
Example #11
0
 public void Init()
 {
     role      = GetComponent <PlayerControl>();
     movDct    = GetComponent <MoveDetect>();
     groundDct = GetComponent <GroundDetect>();
     _animator = GetComponent <AnimatorControl>();
     //roleActionsControl = RoleActionsInputBindings.ActionsBindings();
 }
        private void UnFreezeAnimator(AnimatorControl p_model)
        {
            Animator component = p_model.GetComponent <Animator>();

            if (component != null)
            {
                component.speed = 1f;
            }
        }
 protected override void Awake()
 {
     base.Awake();
     if (m_Animator == null)
     {
         m_Animator = this.GetComponent <Animator>(true);
     }
     if (m_AnimatorControl == null)
     {
         m_AnimatorControl = this.GetComponent <AnimatorControl>(true);
     }
     m_Animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
 }
Example #14
0
 protected override void Awake()
 {
     base.Awake();
     if (m_animator == null)
     {
         m_animator = this.GetComponent <Animator>(true);
     }
     if (m_animatorControl == null)
     {
         m_animatorControl = this.GetComponent <AnimatorControl>(true);
     }
     m_animator.cullingMode = AnimatorCullingMode.BasedOnRenderers;
     m_MainView             = this.GetComponent <LevelEntityView>(true);
 }
Example #15
0
    void Awake()
    {
        myAnim     = GameObject.FindGameObjectWithTag("Player").GetComponent <AnimatorControl>();
        ForeSprite = this.transform.Find("Foreground").GetComponent <UISprite>();

        if (btnType == 0)
        {
            beamRifle = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <UseBeamRifle>();
        }
        else if (btnType == 1)
        {
            multiLaser = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <MultiTargetLaser>();
        }
        else
        {
            myUnitState = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <UnitState>();
        }
    }
Example #16
0
 protected override void Awake()
 {
     base.Awake();
     if (m_animator == null)
     {
         m_animator = this.GetComponent <Animator>(true);
     }
     if (m_animatorControl == null)
     {
         m_animatorControl = this.GetComponent <AnimatorControl>(true);
     }
     if (m_eventHandler == null)
     {
         m_eventHandler = this.GetComponentInChildren <BaseEventHandler>(true);
     }
     m_animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
     m_MainView             = this.GetComponent <LevelEntityView>(true);
 }
Example #17
0
    // Use this for initialization
    void Start()
    {
        mainBody = transform.FindChild("body");
        model    = mainBody.FindChild("model");

        poise1 = transform.FindChild("poise1");
        poise2 = transform.FindChild("poise2");

        foot1 = GameObject.Find("foot1");
        foot2 = GameObject.Find("foot2");

        state          = RoleState.Falling;
        layerCollision = LayerMask.GetMask("ground") | LayerMask.GetMask("Platform");
        layerGround    = LayerMask.GetMask("ground");

        _animator = GetComponent <AnimatorControl>();

        roleActionsControl = RoleActionsInputBindings.ActionsBindings();
    }
Example #18
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));
            }
        }
Example #19
0
    public void Init()
    {
        ColliderSize = transform.Find("body").Find("collider").lossyScale;

        state = RoleState.Falling;

        groundDct = GetComponent <GroundDetect>();

        jumpProc = GetComponent <JumpProcess>();
        jumpProc.Init();

        fallProc = GetComponent <FallProcess>();

        slideProc = GetComponent <SlideProcess>();

        moveProc = GetComponent <MoveProcess>();
        moveProc.init();

        cliffDct = GetComponent <CliffDetect>();

        animator = GetComponent <AnimatorControl>();
    }
Example #20
0
 protected override void Awake()
 {
     m_DieHash = Animator.StringToHash("DIE");
     base.Awake();
     if (m_Animator == null)
     {
         m_Animator = this.GetComponent <Animator>(true);
     }
     if (m_AnimatorControl == null)
     {
         m_AnimatorControl = this.GetComponent <AnimatorControl>(true);
     }
     m_Animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
     if (m_DisableRendererTimed)
     {
         AbilityViewMonster component = GetComponent <AbilityViewMonster>();
         if (component != null)
         {
             component.ChangeExplosiveAbilityDelay(m_RendererDisableTime);
         }
     }
 }
Example #21
0
        private IEnumerator PlayEnd()
        {
            Single animDelay = 1f;

            m_Animation.Play("Cam_SPE_Finish");
            Single length = m_Animation["Cam_SPE_Finish"].length;

            yield return(new WaitForSeconds(animDelay * 0.5f));

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

            if (view != null)
            {
                AnimatorControl anim = view.GetComponentInChildren <AnimatorControl>();
                if (anim != null)
                {
                    anim.IdleSpecial(1);
                }
            }
            yield return(new WaitForSeconds(animDelay * 0.5f));

            view = ViewManager.Instance.FindView(42);
            if (view != null)
            {
                AnimatorControl anim2 = view.GetComponentInChildren <AnimatorControl>();
                if (anim2 != null)
                {
                    anim2.IdleSpecial(1);
                }
            }
            yield return(new WaitForSeconds(length - animDelay));

            FXMainCamera.Instance.CameraModus = FXMainCamera.EModus.Normal;
            FXMainCamera.Instance.ResetCameraTransformation();
            m_Root.SetActive(false);
            m_CutsceneView.MyController.StopCutscene();
            yield break;
        }
Example #22
0
    public static void Run(AnimatorControl control)
    {
        mControl = control;
        if (mControl.IsNull())
        {
            return;
        }
        if (mControl.Animator == null)
        {
            mControl.Reset();
        }
        AnimatorController animatorController = mControl.Animator.runtimeAnimatorController as AnimatorController;

        if (animatorController != null)
        {
            AnimatorStateMachine stateMachine = animatorController.layers[0].stateMachine;
            List <string>        nameList     = new List <string>();
            List <int>           hashList     = new List <int>();
            GetValue(stateMachine, nameList, hashList, stateMachine.name);
            CheckHaveBehaviour(stateMachine);
            mControl.FullStateName     = nameList.ToArray();
            mControl.FullStateNameHash = hashList.ToArray();
        }
    }
Example #23
0
 // Use this for initialization
 void Awake()
 {
     myAnim     = this.transform.root.GetComponent <AnimatorControl>();
     myAnimator = this.GetComponent <Animator>();
 }