Ejemplo n.º 1
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     base.OnStateEnter(animator, stateInfo, layerIndex);
     ClearTrigger(true);
     if (null == m_AnimCtrl)
     {
         m_AnimCtrl = animator.GetComponent <AnimatorCtrl>();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create new layers on the Animator with a specific name
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public AnimatorControllerLayer AddLayer(string name)
        {
            var layer = new AnimatorControllerLayer {
                name         = name,
                stateMachine = new AnimatorStateMachine {
                    name = "Default"
                }
            };

            layer.stateMachine.defaultState = layer.stateMachine.AddState("Default");
            AnimatorCtrl.AddLayer(layer);

            return(layer);
        }
Ejemplo n.º 3
0
    public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        base.OnStateEnter(animator, stateInfo, layerIndex);
        if (null == m_AnimCtrl)
        {
            m_AnimCtrl = animator.GetComponent <AnimatorCtrl>();
        }

        SendMsg(animator, m_EnterEvent);

        for (int i = 0; i < events.Length; i++)
        {
            events[i].eventSended = false;
        }
    }
    public void ChangeChair(int index)
    {
        // reset all cameras
        foreach (var unit in Units)
        {
            unit.Obj.SetActive(false);
        }

        var u = Units[index];

        u.Obj.SetActive(true);
        unitName.text = u.name;
        currAnimator  = u.Animator;
        ChairColor    = u.ChangeColor;
        ResetStates.ResetObjects();
        ResetStates.bandejaPrincipal.SetObjectActive(true);
    }
Ejemplo n.º 5
0
    public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        base.OnStateExit(animator, stateInfo, layerIndex);

        if (null == m_AnimCtrl)
        {
            m_AnimCtrl = animator.GetComponent <AnimatorCtrl>();
        }

        SendMsg(animator, m_EixtEvent);

        for (int i = 0; i < events.Length; i++)
        {
            if (!events[i].eventSended)
            {
                SendMsg(animator, events[i].eventStr);
            }
        }
    }
Ejemplo n.º 6
0
 void Start()
 {
     animatorCtrl = GameObject.FindGameObjectWithTag("Player").GetComponent <AnimatorCtrl>();
 }