Пример #1
0
        public void ExecuteOnTarget(HeroKitObject targetObject, float duration)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.moveDuration = duration;
        }
Пример #2
0
        public void ExecuteOnTarget(HeroKitObject targetObject, float speed)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.moveSpeed = speed;
        }
Пример #3
0
        public void ExecuteOnTarget(HeroKitObject targetObject)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.faceDirectionOnMove = false;
        }
Пример #4
0
        public void ExecuteOnTarget(HeroKitObject targetObject)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.animateOnMove = true;
        }
Пример #5
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;
            }
        }
Пример #6
0
        public void ExecuteOnTarget(HeroKitObject targetObject)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.finishMoveWhenCollide = false;
        }
Пример #7
0
        public void ExecuteOnTarget(HeroKitObject targetObject, int layerMask)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.finishMoveWhenCollide = true;
            moveObject.collisionLayers       = layerMask;
        }
Пример #8
0
        public void ExecuteOnTarget(HeroKitObject targetObject, int speed, int moveType, int animationType)
        {
            // get the movement script
            HeroSettings2D moveSettings = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveSettings.animType  = (HeroSettings2D.AnimType)(animationType - 1);
            moveSettings.moveType  = (HeroSettings2D.MoveType)(moveType - 1);
            moveSettings.animator  = targetObject.GetHeroChildComponent <Animator>("Animator", HeroKitCommonRuntime.visualsName);
            moveSettings.moveSpeed = speed;
            moveSettings.faceDir   = HeroSettings2D.FaceDir.down;

            RpgController2D moveObject = targetObject.GetHeroComponent <RpgController2D>("RpgController2D", true);
        }
Пример #9
0
        public void ExecuteOnTarget(HeroKitObject targetObject, bool useLayers)
        {
            // get the jump script & set values
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            moveObject.useJumpLayermask = useLayers;
            moveObject.jumpLayermask    = LayerMaskValue.GetValue(heroKitObject, 3);

            //if (!moveObject.haveJumped)
            //{
            //    moveObject.enabled = false;
            //}
        }
Пример #10
0
        public void ExecuteOnTarget(HeroKitObject targetObject, int speed, int moveType, int animationType, bool changeSpeed, bool changeMove, bool changeAnim)
        {
            HeroSettings2D moveSettings = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            if (changeAnim)
            {
                moveSettings.animType = (HeroSettings2D.AnimType)(animationType - 1);
            }
            if (changeMove)
            {
                moveSettings.moveType = (HeroSettings2D.MoveType)(moveType - 1);
            }
            moveSettings.animator = targetObject.GetHeroChildComponent <Animator>("Animator", HeroKitCommonRuntime.visualsName);
            if (changeSpeed)
            {
                moveSettings.moveSpeed = speed;
            }
        }
Пример #11
0
        public void ExecuteOnTarget(HeroKitObject targetObject, string[] moveNames, string[] faceNames)
        {
            // get the movement script
            HeroSettings2D moveObject = targetObject.GetHeroComponent <HeroSettings2D>("HeroSettings2D", true);

            // add the custom names for your animation
            if (moveNames != null && moveNames.Length > 0)
            {
                if (moveNames[0] != "")
                {
                    moveObject.moveDefault = moveNames[0];
                }
                if (moveNames[1] != "")
                {
                    moveObject.moveLeft = moveNames[1];
                }
                if (moveNames[2] != "")
                {
                    moveObject.moveRight = moveNames[2];
                }
                if (moveNames[3] != "")
                {
                    moveObject.moveUp = moveNames[3];
                }
                if (moveNames[4] != "")
                {
                    moveObject.moveDown = moveNames[4];
                }
                if (moveNames[5] != "")
                {
                    moveObject.moveUpLeft = moveNames[5];
                }
                if (moveNames[6] != "")
                {
                    moveObject.moveUpRight = moveNames[6];
                }
                if (moveNames[7] != "")
                {
                    moveObject.moveDownLeft = moveNames[7];
                }
                if (moveNames[8] != "")
                {
                    moveObject.moveDownRight = moveNames[8];
                }
            }

            if (faceNames != null && faceNames.Length > 0)
            {
                if (faceNames[0] != "")
                {
                    moveObject.lookDefault = faceNames[0];
                }
                if (faceNames[1] != "")
                {
                    moveObject.lookLeft = faceNames[1];
                }
                if (faceNames[2] != "")
                {
                    moveObject.lookRight = faceNames[2];
                }
                if (faceNames[3] != "")
                {
                    moveObject.lookUp = faceNames[3];
                }
                if (faceNames[4] != "")
                {
                    moveObject.lookDown = faceNames[4];
                }
                if (faceNames[5] != "")
                {
                    moveObject.lookUpLeft = faceNames[5];
                }
                if (faceNames[6] != "")
                {
                    moveObject.lookUpRight = faceNames[6];
                }
                if (faceNames[7] != "")
                {
                    moveObject.lookDownLeft = faceNames[7];
                }
                if (faceNames[8] != "")
                {
                    moveObject.lookDownRight = faceNames[8];
                }
            }
        }