Пример #1
0
    public void Shoot(SpheroWeaponType type, float direction)
    {
        //Get the ProjectileControl object associated with the shooting player
        String            playerName       = DeviceName.ToLower().Contains("boo") ? "player1" : "player2";
        ProjectileControl playerProjectile = GameObject.Find(playerName).GetComponent <ProjectileControl>();

        //Put the direction into the correct range
        direction += (float)Math.PI;

        //Covert the direction into a vector
        Vector3 directionVector = new Vector3((float)Math.Cos(direction), (float)Math.Sin(direction), 0.0f);

        //Tell the sphero to shoot
        playerProjectile.Shoot(directionVector);
    }
Пример #2
0
 // TODO more weapon stats.
 public SpheroWeapon(SpheroWeaponType type)
 {
     Type = type;
 }
Пример #3
0
    public void Shoot(SpheroWeaponType type, float direction)
    {
        //Get the ProjectileControl object associated with the shooting player
        String playerName = DeviceName.ToLower().Contains("boo") ? "player1" : "player2";
        ProjectileControl playerProjectile =  GameObject.Find(playerName).GetComponent<ProjectileControl>();

        //Put the direction into the correct range
        direction += (float)Math.PI;

        //Covert the direction into a vector
        Vector3 directionVector = new Vector3((float)Math.Cos(direction), (float)Math.Sin(direction), 0.0f);

        //Tell the sphero to shoot
        playerProjectile.Shoot(directionVector);
    }
Пример #4
0
    // TODO more weapon stats.

    public SpheroWeapon(SpheroWeaponType type)
    {
        Type = type;
    }