Ejemplo n.º 1
0
        public void ExecuteOnTarget(HeroKitObject targetObject, bool changeStartAnim, bool changeEndAnim)
        {
            // get the animator component
            Animator animator = targetObject.GetHeroChildComponent <Animator>("Animator", HeroKitCommonRuntime.visualsName);

            if (animator != null)
            {
                // get the movement script
                moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

                if (changeStartAnim)
                {
                    moveObject.jumpBegin = AnimationParameterValue.GetValueA(heroKitObject, 3, 4, 5);
                }

                if (changeEndAnim)
                {
                    moveObject.jumpEnd = AnimationParameterValue.GetValueA(heroKitObject, 7, 8, 9);
                }

                //// disable jump script if it is not being used
                //if (!moveObject.haveJumped)
                //    moveObject.enabled = false;
            }
        }
Ejemplo n.º 2
0
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            // get values
            heroKitObject = hko;
            HeroKitObject[] targetObject  = HeroObjectFieldValue.GetValueE(heroKitObject, 0, 1);
            string          animationName = AnimationParameterValue.GetValueA(heroKitObject, 2, 3, 4);
            bool            runThis       = (animationName != "" && targetObject != null);

            if (runThis)
            {
                // set up long data for animations
                animInfo = new LegacyAnimationInfo[targetObject.Length];

                // execute action for all objects in list
                for (int i = 0; runThis && i < targetObject.Length; i++)
                {
                    ExecuteOnTarget(targetObject[i], animationName, i);
                }
            }

            // set up the long action
            eventID = heroKitObject.heroStateData.eventBlock;
            heroKitObject.heroState.heroEvent[eventID].waiting = true;
            updateIsDone = false;
            heroKitObject.longActions.Add(this);

            if (heroKitObject.debugHeroObject)
            {
                string debugMessage = animationName + ": " + "on";
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject, debugMessage));
            }

            return(-99);
        }
Ejemplo n.º 3
0
        public void ExecuteOnTarget(HeroKitObject targetObject, bool changeStartAnim, bool changeEndAnim)
        {
            // get the movement script
            moveObject = targetObject.GetHeroComponent <HeroSettings3D>("HeroSettings3D", true);
            if (moveObject.animator != null)
            {
                if (changeStartAnim)
                {
                    moveObject.animationJumpBegin = AnimationParameterValue.GetValueA(heroKitObject, 3, 4, 5);
                }

                if (changeEndAnim)
                {
                    moveObject.animationJumpEnd = AnimationParameterValue.GetValueA(heroKitObject, 7, 8, 9);
                }
            }
        }
Ejemplo n.º 4
0
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            // get values
            heroKitObject = hko;
            HeroKitObject[] targetObject  = HeroObjectFieldValue.GetValueE(heroKitObject, 0, 1);
            string          animationName = AnimationParameterValue.GetValueA(heroKitObject, 2, 3, 4);
            bool            runThis       = (animationName != "" && targetObject != null);

            // execute action for all objects in list
            for (int i = 0; runThis && i < targetObject.Length; i++)
            {
                ExecuteOnTarget(targetObject[i], animationName);
            }

            if (heroKitObject.debugHeroObject)
            {
                string debugMessage = animationName + ": " + true;
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject, debugMessage));
            }

            return(-99);
        }
Ejemplo n.º 5
0
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            heroKitObject = hko;
            HeroKitObject[] targetObject  = HeroObjectFieldValue.GetValueE(heroKitObject, 0, 1);
            int             speed         = IntegerFieldValue.GetValueA(heroKitObject, 2);
            int             animationType = DropDownListValue.GetValue(heroKitObject, 3);
            string          walkAnimation = AnimationParameterValue.GetValueA(heroKitObject, 4, 5, 6);
            string          idleAnimation = (animationType == 2) ? AnimationParameterValue.GetValueA(heroKitObject, 7, 8, 9) : "";
            bool            runThis       = (targetObject != null);

            // execute action for all objects in list
            for (int i = 0; runThis && i < targetObject.Length; i++)
            {
                ExecuteOnTarget(targetObject[i], speed, animationType, walkAnimation, idleAnimation);
            }

            if (heroKitObject.debugHeroObject)
            {
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject));
            }

            return(-99);
        }
Ejemplo n.º 6
0
        // Execute the action
        public int Execute(HeroKitObject hko)
        {
            // get values
            heroKitObject = hko;
            HeroKitObject[] targetObject  = HeroObjectFieldValue.GetValueE(heroKitObject, 0, 1);
            string          animationName = AnimationParameterValue.GetValueA(heroKitObject, 2, 3, 4);
            bool            runThis       = (targetObject != null && animationName != "");

            // execute action for all objects in list
            for (int i = 0; runThis && i < targetObject.Length; i++)
            {
                ExecuteOnTarget(targetObject[i], animationName);
            }

            // debug message
            if (heroKitObject.debugHeroObject)
            {
                string moveAnimation = (moveObject != null) ? moveObject.settings.moveDefault : "";
                string debugMessage  = "Move Animation: " + moveAnimation;
                Debug.Log(HeroKitCommonRuntime.GetActionDebugInfo(heroKitObject, debugMessage));
            }

            return(-99);
        }