ForceJump() 공개 메소드

Force Character to Jump! User must be sure of what they are doing... this doesn't check anything
public ForceJump ( Jump j ) : void
j Jump
리턴 void
예제 #1
0
        /// <summary>
        /// Force a player to jump!
        /// </summary>
        public virtual void StartJump(Character character)
        {
            CharacterActionJump actionJump = character.GetAction <CharacterActionJump>();

            Assert.IsNotNull(actionJump, "(Jumper) Missing Monobehaviour CharacterActionJump at " + character.gameObject.GetFullName());

            actionJump.ForceJump(
                new JumpConstantSpring(character, jumpProperties.Clone(1))
                );
        }
예제 #2
0
        public virtual void StartJump(Character c)
        {
            // search CharacterActionJump
            CharacterActionJump actionJump = null;

            foreach (var x in c.actions)
            {
                if (x is CharacterActionJump)
                {
                    actionJump = x as CharacterActionJump;
                }
            }

            if (actionJump != null)
            {
                actionJump.ForceJump(
                    new JumpConstantSpring(c, jumpProperties.Clone(1))
                    );
            }
            else
            {
                Debug.LogWarning("character found without CharacterActionJump so ignore.");
            }
        }
 void OnHurtCharacter(Damage dt, CharacterHealth h, Character to)
 {
     actionJump.ForceJump(new JumpConstant(character,
                                           jumpProperties.Clone((int)character.faceDir)
                                           ));
 }