Esempio n. 1
0
        /// <summary>
        /// Override to set the cursor animation trigger
        /// </summary>
        /// <param name="modifier"></param>
        protected override void OnActiveModifier(CursorModifier modifier)
        {
            base.OnActiveModifier(modifier);
            if (Input.GetKey("joystick button 15"))
            {
                //    Debug.Log(string.Format("Fire ......"));
                Debug.Log(string.Format("COURSOR is here ......") + modifier.transform.position);
            }

            if (modifier != null)
            {
                if ((modifier.CursorParameters != null) && (modifier.CursorParameters.Length > 0))
                {
                    OnCursorStateChange(CursorStateEnum.Contextual);
                    foreach (var param in modifier.CursorParameters)
                    {
                        SetAnimatorParameter(param);
                    }
                }
            }
            else
            {
                OnCursorStateChange(CursorStateEnum.None);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Updates the currently targeted object and cursor modifier upon getting
        /// an event indicating that the focused object has changed.
        /// </summary>
        /// <param name="pointer">The pointer associated with this focus change.</param>
        /// <param name="oldFocusedObject">Object that was previously being focused.</param>
        /// <param name="newFocusedObject">New object being focused.</param>
        protected virtual void OnPointerSpecificFocusChanged(IPointingSource pointer, GameObject oldFocusedObject, GameObject newFocusedObject)
        {
            if (pointer == Pointer)
            {
                TargetedObject = newFocusedObject;

                CursorModifier newModifier = (newFocusedObject == null)
                    ? null
                    : newFocusedObject.GetComponent <CursorModifier>();

                OnActiveModifier(newModifier);
            }
        }
        /// <summary>
        /// Override to set the cursor anim trigger
        /// </summary>
        /// <param name="modifier"></param>
        protected override void OnActiveModifier(CursorModifier modifier)
        {
            base.OnActiveModifier(modifier);

            if (modifier != null)
            {
                if (!string.IsNullOrEmpty(modifier.CursorTriggerName))
                {
                    OnCursorStateChange(CursorStateEnum.Contextual);
                    CursorAnimator.SetTrigger(modifier.CursorTriggerName);
                }
            }
            else
            {
                OnCursorStateChange(CursorStateEnum.None);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Override to set the cursor anim trigger
        /// </summary>
        /// <param name="modifier"></param>
        protected override void OnActiveModifier(CursorModifier modifier)
        {
            base.OnActiveModifier(modifier);

            if (modifier != null)
            {
                if ((modifier.CursorParameters != null) && (modifier.CursorParameters.Length > 0))
                {
                    OnCursorStateChange(CursorStateEnum.Contextual);
                    foreach (var param in modifier.CursorParameters)
                    {
                        SetAnimatorParameter(param);
                    }
                }
            }
            else
            {
                OnCursorStateChange(CursorStateEnum.None);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Override function when a new modifier is found or no modifier is valid
 /// </summary>
 /// <param name="modifier"></param>
 protected virtual void OnActiveModifier(CursorModifier modifier)
 {
     TargetedCursorModifier = modifier;
 }
        /// <summary>
        /// Override to set the cursor anim trigger
        /// </summary>
        /// <param name="modifier"></param>
        protected override void OnActiveModifier(CursorModifier modifier)
        {
            base.OnActiveModifier(modifier);

            if (modifier != null)
            {
                if(!string.IsNullOrEmpty(modifier.CursorTriggerName))
                {
                    OnCursorStateChange(CursorStateEnum.Contextual);
                    CursorAnimator.SetTrigger(modifier.CursorTriggerName);
                }
            }
            else
            {
                OnCursorStateChange(CursorStateEnum.None);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Override function when a new modifier is found or no modifier is valid
 /// </summary>
 /// <param name="modifier"></param>
 protected virtual void OnActiveModifier(CursorModifier modifier)
 {
     TargetedCursorModifier = modifier;
 }