void AddKeyboardPlayerController(int playerIndex, int playerControllerIndex) { Player player = players[playerIndex]; KeyboardPlayerController keyboardController = player.transform.gameObject.AddComponent <KeyboardPlayerController>(); keyboardController.SetPlayerInputIndex(playerControllerIndex); keyboardController.SetTeamIndex(player.teamIndex); keyboardController.SetPlayerController(player.controller); player.customControllers.Add(keyboardController); }
public override void OnInspectorGUI() { DrawDefaultInspector(); KeyboardPlayerController player = (KeyboardPlayerController)target; if (GUILayout.Button("Drop Player")) { player.DropPlayer(); } }
protected override void Start() { base.Start(); triggerVolume = GetComponent <Collider>(); player = FindObjectOfType <KeyboardPlayerController>(); InteractionIsHeld = false; if (fixedCamera == null) { fixedCamera = GetComponentInChildren <Camera>().gameObject; } }
void Start() { StartCoroutine(waitForColor()); cs = GetComponent <CharacterSelectController>(); index = cs.currentMaterialIndex; LObject = Instantiate(prefabLight[index]); ps = LObject.GetComponentsInChildren <ParticleSystem>(); kp = GetComponent <KeyboardPlayerController>(); LObject.transform.position = this.transform.position; ad.Play(); ad.Pause(); //index++; }
private void OnTriggerEnter(Collider other) { KeyboardPlayerController player = other.gameObject.GetComponent <KeyboardPlayerController>(); if (player != null) { StartCoroutine(player.OutOfBounds(spawnPoint, fadeInTime, fadeOutTime)); return; } IcePotion potion = other.gameObject.GetComponent <IcePotion>(); if (potion != null) { potion.TriggerFromWater(transform); } }
void Start() { kp = GetComponent <KeyboardPlayerController>(); bc = GetComponent <BoxCollider2D>(); }
void Start() { rd = GetComponentInParent <GravityObjectRigidBody>(); kp = GetComponentInParent <KeyboardPlayerController>(); }
private void PickUpMagnifyingGlass() { KeyboardPlayerController.ActivateMagnifyingGlass(); gameObject.SetActive(false); Debug.Log("Interacted w/ magnifying glass."); }