Example #1
0
    void Start()
    {
        initialPosition = transform.localPosition; //position based on the parent not the world
        initialRotation = transform.localRotation.eulerAngles;

        weaponAnimations = GetComponent <WeaponAnimations>();
        weaponAudio      = GetComponent <WeaponAudio>();
        weaponManager    = GetComponent <WeaponManager>();
        weaponADS        = GetComponent <WeaponAimDownSights>();
    }
Example #2
0
        public string GetSoundEffect(WeaponAnimations anim)
        {
            int index = (int)anim;
            if (SoundEffects[index].Count == 0)
                return string.Empty;
            if (SoundEffects[index].Count == 1)
                return SoundEffects[index][0];

            int randIndex = RandomHelper.RandomGen.Next(0, SoundEffects[index].Count);
            return SoundEffects[index][randIndex];
        }
Example #3
0
        private void SetupSprites()
        {
            WeaponAnimation    = WeaponAnimations.Animation(AnimationStatus.Still_Right);
            WeaponSprite       = new SpriteNode(WeaponAnimation);
            WeaponSprite.Layer = 1;
            AddChild(WeaponSprite);

            HelmAnimation       = HelmAnimations.Animation(AnimationStatus.Still_Right);
            HelmSprite          = new SpriteNode(HelmAnimation);
            HelmSprite.Position = new Location(0, -4);
            HelmSprite.Layer    = -1;
            AddChild(HelmSprite);
        }
Example #4
0
 void Start()
 {
     initialPosition  = transform.localPosition; //position in respect to the parent (player)
     weaponAnimations = GetComponent <WeaponAnimations>();
 }
Example #5
0
 public static void SetWeaponAnimation(this Player player, WeaponAnimations animation)
 {
     player.WeaponAnimation = (int)animation;
 }
Example #6
0
 public static void SetWeaponAnimation(this Player player, WeaponAnimations animation)
 {
     player.WeaponAnimation = (int)animation;
 }