private void OnEnable() { _dsp = target as Hv_shields_AudioLib; }
private void Start() { // Set the position, and make the player start out looking at the enemy ship. this.transform.position = spawnPoint.transform.position; this.transform.LookAt(GameObject.FindGameObjectWithTag("Ship_P2").transform); anim = GetComponent <Animator>(); anim.SetBool("Moving", false); shieldScript = GetComponent <Hv_shields_AudioLib>(); // Find and set barriers LeftBarr = GameObject.Find("ShieldActivatePoint1P" + playerNum); RightBarr = GameObject.Find("ShieldActivatePoint2P" + playerNum); FrontBarr = GameObject.Find("ShieldActivatePoint3P" + playerNum); BackBarr = GameObject.Find("ShieldActivatePoint4P" + playerNum); OOM = GameObject.Find("OOMTextP" + playerNum); OOM.SetActive(false); // If we came from the custom ball selector, find the settings and apply them. if (GameObject.Find("InfoStorage") != null) { Loadout = GameObject.Find("InfoStorage").GetComponent <InfoStore>().GetLoadout(playerNum); } else { // If we didn't come from custom loadout selector, set a default loadout. Fire, Ice, and Lightning. Loadout = new int[] { 0, 1, 2 }; } // Startup mana regen manaCost = 0; manaRegen = Regen(); StartCoroutine(manaRegen); OOMCaller = OOMCall(); // Set input dictionary appropriate to player if (playerNum == 1) { playerInput = new Dictionary <int, string>() { { 0, "X_1" }, { 1, "Y_1" }, { 2, "A_1" }, { 3, "B_1" }, { 4, "RightStickX" }, { 5, "RightStickY" }, { 6, "Horizontal" }, { 7, "Vertical" }, { 8, "LeftBumper" }, { 9, "RightBumper" }, { 10, "LeftTrigger" }, { 11, "RightTrigger" } }; } else if (playerNum == 2) { playerInput = new Dictionary <int, string>() { { 0, "X_2" }, { 1, "Y_2" }, { 2, "A_2" }, { 3, "B_2" }, { 4, "RightStickX_2" }, { 5, "RightStickY_2" }, { 6, "Horizontal_2" }, { 7, "Vertical_2" }, { 8, "LeftBumper_2" }, { 9, "RightBumper_2" }, { 10, "LeftTrigger_2" }, { 11, "RightTrigger_2" } }; } else { Debug.LogWarning("Player Number not set!"); } }