コード例 #1
0
    //sets the type of projectile based on weapon type
    public void SetType(Main.WeaponType eType)
    {
        _type = eType;
        WeaponDefintion def = Main.GetWeaponDefintion(_type);

        _rend.material.color = def.projectileColor;
    }
コード例 #2
0
ファイル: Weapon.cs プロジェクト: irfanyusra/YAP-Shooter
 // sets the weapon type based on the definition in the main
 public void SetType(Main.WeaponType wt)
 {
     _type = wt;
     this.gameObject.SetActive(true);
     def = Main.GetWeaponDefintion(_type);             // gets the defintion for the type of weapon
     _collarRend.material.color = def.projectileColor; // sets the collar to projectile colour
     lastShotTime = 0;                                 // set the last shot time to be 0 so that the weapon can be shot
 }
コード例 #3
0
    public void SetType(Main.WeaponType wt)
    {
        // get weapon defintion from main
        WeaponDefintion def = Main.GetWeaponDefintion(wt);

        cubeRend.material.color = def.projectileColor; // set the colour
        type        = wt;                              // set the type
        letter.text = def.letter;                      // set the letter
    }
コード例 #4
0
ファイル: Enemy.cs プロジェクト: irfanyusra/YAP-Shooter
    void Awake()
    {
        bndCheck        = GetComponent <BoundsCheck>(); // gets the bounds check component
        enemy1Direction = (Random.value > 0.5f);        //determines whether the enemy 1 will go right or left

        float dropChance = 1.0f;                        // to select if this enemy will have a drop chance

        if (Random.value <= dropChance)                 // if the the random number is less than or equal to powerupdrop chance it will drop a power up
        {
            int randomPowerUp = Random.Range(0, 3);     // selects the powerup from the list 0,1
            puType = powerUps[randomPowerUp];
        }
    }