Exemplo n.º 1
0
    // This method spawns each enemy wave for the teams
    // Sends data to each minion playerstats script
    void SpawnMinion()
    {
        if (team == "blue")
        {
            adFinal  = scoreScript.blueTeamScore;
            adFinal *= 2;
            GameObject minionObj = PhotonNetwork.Instantiate("MinionsBlueCreator_mn", transform.position, transform.rotation, 0);
            //waypointScript = minionObj.GetComponent<WaypointProgressTracker>();
            playerStatScript    = minionObj.GetComponent <PlayerStats>();
            minionScript        = minionObj.GetComponent <MinionsScript>();
            minionScript.target = BlueTarget;
            //waypointScript.circuit = circuitScript;
            minionObj.name = "BlueWave" + waveNumber.ToString();
        }
        if (team == "red")
        {
            adFinal  = scoreScript.redTeamScore;
            adFinal *= 2;
            GameObject minionObj = PhotonNetwork.Instantiate("MinionsRedCreator_mn", transform.position, transform.rotation, 0);
            //waypointScript = minionObj.GetComponent<WaypointProgressTracker>();
            playerStatScript    = minionObj.GetComponent <PlayerStats>();
            minionScript        = minionObj.GetComponent <MinionsScript>();
            minionScript.target = RedTarget;
            //waypointScript.circuit = circuitScript;
            minionObj.name = "RedWave" + waveNumber.ToString();
        }
        playerStatScript.playerTeam       = team;
        playerStatScript.maxHealth        = health + adFinal;
        playerStatScript.myHealth         = health + adFinal;
        playerStatScript.healthRegenerate = healthRegen;
        playerStatScript.playerLvl        = lvl;
        playerStatScript.expToGive        = expToGive;
        playerStatScript.goldToGive       = goldToGive;
        playerStatScript._bAdValue        = ad + adFinal;
        playerStatScript._bApValue        = ap;
        playerStatScript.adRes            = adRes;
        playerStatScript.apRes            = apRes;
        minionScript.attackSpeed          = 3;

        waveNumber++;
    }
Exemplo n.º 2
0
    // This method spawns each enemy wave for the teams
    // Sends data to each minion playerstats script
    void SpawnMinion()
    {
        if (team == "blue")
        {
            adFinal  = scoreScript.blueTeamScore;
            adFinal *= 2;
            GameObject minionObj = (GameObject)uLink.Network.Instantiate(uLink.NetworkPlayer.server, BlueMinionProxy, BlueMinionProxy, BlueMinionCreator, transform.position, transform.rotation, 0);
            waypointScript         = minionObj.GetComponent <WaypointProgressTracker>();
            playerStatScript       = minionObj.GetComponent <PlayerStats>();
            minionScript           = minionObj.GetComponent <MinionsScript>();
            waypointScript.circuit = circuitScript;
            minionObj.name         = "BlueWave" + waveNumber.ToString();
        }
        if (team == "red")
        {
            adFinal  = scoreScript.redTeamScore;
            adFinal *= 2;
            GameObject minionObj = (GameObject)uLink.Network.Instantiate(uLink.NetworkPlayer.server, RedMinionProxy, RedMinionProxy, RedMinionCreator, transform.position, transform.rotation, 0);
            waypointScript         = minionObj.GetComponent <WaypointProgressTracker>();
            playerStatScript       = minionObj.GetComponent <PlayerStats>();
            minionScript           = minionObj.GetComponent <MinionsScript>();
            waypointScript.circuit = circuitScript;
            minionObj.name         = "RedWave" + waveNumber.ToString();
        }
        playerStatScript.playerTeam       = team;
        playerStatScript.maxHealth        = health + adFinal;
        playerStatScript.myHealth         = health + adFinal;
        playerStatScript.healthRegenerate = healthRegen;
        playerStatScript.playerLvl        = lvl;
        playerStatScript.expToGive        = expToGive;
        playerStatScript.goldToGive       = goldToGive;
        playerStatScript._bAdValue        = ad + adFinal;
        playerStatScript._bApValue        = ap;
        playerStatScript.adRes            = adRes;
        playerStatScript.apRes            = apRes;
        playerStatScript.UpdateStatsOnClients();
        minionScript.attackSpeed = 3;

        waveNumber++;
    }