Пример #1
0
    void SpawnProjectile(Vector3 position, Quaternion rotation,
                         string originatorName, string team)
    {
        // Access the BlasterScript of the newly instantiated
        // Blaster projectile and supply the player's name
        // and team
        GameObject    go      = Instantiate(Blaster, position, rotation) as GameObject;
        BlasterScript bScript = go.GetComponent <BlasterScript>();

        bScript.myOriginator = originatorName;
        bScript.team         = team;
    }
    void Start()
    {
 

        player = GameObject.Find("Carlos");
        playerGold = player.GetComponent<Player>();
        pistolUpgrade = player.GetComponentInChildren<PistolScript>(true);
		blasterUpgrade = player.GetComponentInChildren<BlasterScript>(true);
		grenadeUpgrade = player.GetComponentInChildren<GrenadeScript>(true);
        PistolDamageUpdate();
        PistolReloadUpdate();
        PistolClipUpdate();
        PistolCritUpdate();
        BlasterDamageUpdate();
        BlasterReloadUpdate();
		BlasterClipUpdate();
		BlasterCritUpdate();
		grenadeDamageUpdate();
		grenadeReloadUpdate();
		grenadeClipUpdate();
		grenadeCritUpdate();
		UpdateDisplay ();
    }