public void ChangeWeapon(int num, HenryWeapon w)
 {
     if(num < 1 || num > 10) {
         Console.WriteLine("Invalid weapon hardpoint access: " + num);
         return;
     }
     Weapons[num-1] = new WeaponIndicator(w, this.Position + new Vector2(45, 0) * (num-1));
 }
Exemple #2
0
    public void beginWeaponChangeNotification(short typeIndex)
    {
        // get child weaponIndicator object -- read its hardpoint's prefab's name
        WeaponIndicator activeWeapIndicator       = indicatorTypeContainers[typeIndex].transform.GetChild(0).GetComponent <WeaponIndicator>();
        Sprite          activeWeapIndicatorSprite = activeWeapIndicator.myHardpoint.weaponTypePrefab.GetComponent <Weapon>().iconImageSpriteFile;

        // enable these to begin editing them
        changeImage.enabled = true;
        changeText.enabled  = true;

        changeImage.sprite = activeWeapIndicatorSprite;                             // set notification image and show
        changeText.text    = activeWeapIndicator.myHardpoint.weaponTypePrefab.name; // set notification text and show

        currentChangeNotificationTimer = changeNotificationTimerMax;                // begin timer
    }