// Use this for initialization void Start() { string[] spellArray = { "Teleport", "MP_Fireball", "Network_Ball", "MP_Shield" }; // Only the local player gets the GVRViewer camera if (isLocalPlayer) { SetupCamera(); SetupPlayerModel(); } else { //this.tag = "nonLocalPlayer"; } this.tag = "Player"; // hook up the GvrController to this player when it is created // Note: this must be called before the wand and player can be instantiated SetupController(); SetupWand(); SetupShield(); //begin player setup playerWand = new MP_Wand(pointer, reticle, 1, 1, spellArray); player = new MP_Player(gameObject, playerWand, teleportDistance); InvokeRepeating("CmdManaRegen", 0, MANA_REGEN_TIME); }
public MP_Player(GameObject player, MP_Wand wand, float teleportDistance) { this.player = player; this.wand = wand; this.teleportDistance = teleportDistance; this.setHealth(this.maxHP = 1.0f); this.setMana(this.maxMana = 1.0f); }