Example #1
0
    internal virtual void Start()
    {
        if (type == SkillType.Passive || position == SkillPosition.Passive)
        {
            type     = SkillType.Passive;
            position = SkillPosition.Passive;
        }

        characterAmmo = GetComponent <CharacterAmmo>();

        if (position == SkillPosition.First)
        {
            hotKey = KeyCode.LeftShift;
        }
        else if (position == SkillPosition.Second)
        {
            hotKey = KeyCode.Space;
        }

        currentCoolDown = 0;
        isInCoolDown    = false;
        isAiming        = false;
        prevIsAiming    = false;
        isToggled       = false;
        prevIsToggled   = false;
    }
Example #2
0
 private void GetStats()
 {
     if (playerHandler != null)
     {
         if (playerHandler.kartInstance != null)
         {
             shield = playerHandler.kartInstance.GetComponent<CharacterShield>();
             health = playerHandler.kartInstance.GetComponent<CharacterHealth>();
             ammo = playerHandler.kartInstance.GetComponent<CharacterAmmo>();
         }
         killsText.text = "K : " + playerHandler.kills;
         deathsText.text = "D : " + playerHandler.deaths;
     }
     else
         LookForPlayerHandler();
 }
Example #3
0
 private void GetStats()
 {
     if (playerHandler != null)
     {
         if (playerHandler.kartInstance != null)
         {
             shield = playerHandler.kartInstance.GetComponent <CharacterShield>();
             health = playerHandler.kartInstance.GetComponent <CharacterHealth>();
             ammo   = playerHandler.kartInstance.GetComponent <CharacterAmmo>();
         }
         killsText.text  = "K : " + playerHandler.kills;
         deathsText.text = "D : " + playerHandler.deaths;
     }
     else
     {
         LookForPlayerHandler();
     }
 }
Example #4
0
    internal virtual void Start()
    {
        if (type == SkillType.Passive || position == SkillPosition.Passive)
        {
            type = SkillType.Passive;
            position = SkillPosition.Passive;
        }

        characterAmmo = GetComponent<CharacterAmmo>();

        if (position == SkillPosition.First)
            hotKey = KeyCode.LeftShift;
        else if (position == SkillPosition.Second)
            hotKey = KeyCode.Space;

        currentCoolDown = 0;
        isInCoolDown = false;
        isAiming = false;
        prevIsAiming = false;
        isToggled = false;
        prevIsToggled = false;
    }
 /// <summary>
 /// Create a NonPlayableCharacter with the specified health, ammo, and weapon objects, plus the given name.
 /// Also, specify the AnimationSet, frameLengthModifier, velocity, position, direction,
 /// and depth of the character.
 /// </summary>
 /// <param name="pipeline">List of objects from which the object should be drawn.</param>
 /// <param name="health">CharacterStatusElement for health</param>
 /// <param name="ammo">CharacterStatusElement for ammo</param>
 /// <param name="weapon">CharacterStatusElement for the current weapon</param>
 /// <param name="name">The character's name</param>
 /// <param name="detector">Collision detector with which this object should register.</param>
 /// <param name="animations">AnimationSet containing all animations for this object</param>
 /// <param name="frameLengthModifier">Float representing the ratio of frames in an animation to movement along the screen</param>
 /// <param name="velocity">Vector of velocity, representing both direction of movement and magnitude</param>
 /// <param name="position">Position of object relative to the top left corner</param>
 /// <param name="direction">Vector representing the direction of the object</param>
 /// <param name="depth">Depth the object is to be drawn to</param>
 public NonPlayableCharacterAbstract(List<DrawableObjectAbstract> pipeline, CharacterHealth health, CharacterAmmo ammo, CharacterWeapon weapon, string name, CollisionDetectorInterface detector, AnimationSet animations, float frameLengthModifier, Vector2 velocity, Vector2 position, Vector2 direction, float depth)
     : base(pipeline, health, ammo, weapon, name, detector, animations, frameLengthModifier, velocity, position, direction, depth)
 {
 }
 /// <summary>
 /// Create a NonPlayableCharacter with the specified health, ammo, and weapon objects, plus the given name
 /// </summary>
 /// <param name="health">CharacterStatusElement for health</param>
 /// <param name="ammo">CharacterStatusElement for ammo</param>
 /// <param name="weapon">CharacterStatusElement for the current weapon</param>
 /// <param name="name">The character's name</param>
 /// <param name="detector">Collision detector with which the object should register.</param>
 public NonPlayableCharacterAbstract(CharacterHealth health, CharacterAmmo ammo, CharacterWeapon weapon, string name, CollisionDetectorInterface detector)
     : base(health, ammo, weapon, name, detector)
 {
 }