Example #1
0
    void RpcRespawn()
    {
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(Vector3.zero, 30.0f, out spawnPoint);
        this.transform.position = spawnPoint;
    }
    // Use this for initialization
    void Start()
    {
        m_rb = GetComponent <Rigidbody>();
        //Debug.Log("Start()");
        Vector3 spawnPoint;
        Vector3 spawnPt;

        spawnPt = new Vector3(Random.Range(-10f, 10f), 1, Random.Range(-10f, 10f));
        ObjectSpawner.RandomPoint(spawnPt, 10f, out spawnPoint);
        this.transform.position = spawnPoint;

        speed  = GameObject.Find("Speed");
        speed1 = GameObject.Find("Speed1");
        speed2 = GameObject.Find("Speed2");
        speed3 = GameObject.Find("Speed3");

        m_hasFlag = false;

        speedPowerUps = 3;

        TrailRenderer tr = GetComponent <TrailRenderer>();

        tr.enabled = false;

        spedUp     = false;
        speedTimer = 0;

        gameOver = false;

        timerText = GameObject.Find("Time").GetComponent <Text> ();
        scoreText = GameObject.Find("Points").GetComponent <Text> ();
        playAgain = GameObject.Find("PlayAgain").GetComponent <Text> ();
        speedText = GameObject.Find("Speeds").GetComponent <Text> ();
    }
    public bool SpawnPower()
    {
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(new Vector3(0, 0, 0), 10.0f, out spawnPoint);
        m_powerOnScreen = Instantiate(m_powerUp, spawnPoint, new Quaternion());
        NetworkServer.Spawn(m_powerOnScreen);
        return(true);
    }
Example #4
0
    public bool P1()
    {
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(new Vector3(0, 0, 0), 20.0f, out spawnPoint);
        GameObject p1 = Instantiate(m_flag[2], spawnPoint, new Quaternion());

        NetworkServer.Spawn(p1);
        return(true);
    }
    public bool SpawnFlag()
    {
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(new Vector3(0, 0, 0), 10.0f, out spawnPoint);
        GameObject flag = Instantiate(m_flag, spawnPoint, new Quaternion());

        NetworkServer.Spawn(flag);
        return(true);
    }
Example #6
0
    public bool SpawnFiringPickUp()
    {
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(new Vector3(0, 0, 0), 30.0f, out spawnPoint);
        GameObject PickUp = Instantiate(FiringPickUp, spawnPoint, new Quaternion());

        NetworkServer.Spawn(PickUp);
        return(true);
    }
    // Use this for initialization
    void Start()
    {
        m_rb = GetComponent <Rigidbody>();
        //Debug.Log("Start()");
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(this.transform.position, 50.0f, out spawnPoint);
        this.transform.position = spawnPoint;

        TrailRenderer tr = GetComponent <TrailRenderer>();

        tr.enabled = false;
    }
    void Start()
    {
        m_rb = GetComponent <Rigidbody>();
        //Debug.Log("Start()");

        if (isLocalPlayer)
        {
            spawnPoints = FindObjectsOfType <NetworkStartPosition>();
        }
        Vector3 spawnPoint;

        ObjectSpawner.RandomPoint(this.transform.position, 10.0f, out spawnPoint);
        this.transform.position = spawnPoint;

        TrailRenderer tr = GetComponent <TrailRenderer>();

        tr.enabled = false;
    }