示例#1
0
    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();
        }
    }
示例#3
0
 protected override void Start()
 {
     base.Start();
     triggerVolume     = GetComponent <Collider>();
     player            = FindObjectOfType <KeyboardPlayerController>();
     InteractionIsHeld = false;
     if (fixedCamera == null)
     {
         fixedCamera = GetComponentInChildren <Camera>().gameObject;
     }
 }
示例#4
0
 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++;
 }
示例#5
0
    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);
        }
    }
示例#6
0
 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.");
 }