예제 #1
0
    public void deactivatePlatform(BotCollector playerBotCollector)
    {
        container.setIsBuilt(false);
        buildObject.SetActive(false);
        ArrayList botIndices = container.GetBotsList();
        // offset the vertical position to accomidate bot height
        Vector3 targetPosition = new Vector3(transform.position.x, transform.position.y + 0.5f, transform.position.z);

        playerBotCollector.RegainBots(botIndices.Count, botIndices, targetPosition, isSwitch);
    }
예제 #2
0
 private void OnTriggerEnter(Collider c)
 {
     if (c.gameObject.CompareTag("Player"))
     {
         BotCollector player = c.gameObject.GetComponent <BotCollector>();
         if (player != null)
         {
             inCollider = true;
             overlayScript.setActivePunchPrompt(true);
         }
     }
 }
예제 #3
0
 public void deactivateSwitch(BotCollector player)
 {
     if (isSwitch)
     {
         Material noCurrent = Resources.Load("NoCurrent") as Material;
         foreach (GameObject wire in wireWithotWithoutCurrent)
         {
             wire.GetComponent <MeshRenderer>().material = noCurrent;
         }
         bot.SetActive(false);
     }
 }
예제 #4
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         player = null;
         if (padLight != null)
         {
             padLight.enabled = false;
         }
         inCollider = false;
         overlayScript.setActiveButtonPrompt(false, botsNeeded);
     }
 }
예제 #5
0
 void ExitConditions(Collider c)
 {
     if (c.tag.Equals("Player"))
     {
         BotCollector playerInventory = c.GetComponent <BotCollector>();
         if (playerInventory.getBots() == numBots)
         {
             StartCoroutine(ExitScene());
         }
         else
         {
             TipPanel.GetInstance().SetText("You're missing bots.");
             TipPanel.GetInstance().SetVisible(true);
         }
     }
 }
예제 #6
0
 private void Activate(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         player = other.gameObject.GetComponent <BotCollector>();
         if (player != null)
         {
             if (padLight != null)
             {
                 padLight.enabled = true;
             }
             inCollider = true;
             overlayScript.setActiveButtonPrompt(true, botsNeeded);
         }
     }
 }
예제 #7
0
 void OnTriggerEnter(Collider c)
 {
     if (c.gameObject.CompareTag("Player") && c.attachedRigidbody != null)
     {
         //NOTE: inventory script was deleted if more problems arise. This is what we changed
         //InventoryScript invent = c.attachedRigidbody.gameObject.GetComponent<InventoryScript>();
         if (/*invent != null &&*/ botMode == BotMode.Idle)
         {
             botMode = BotMode.Follow;
             anim.SetBool("BootUp", true);
             BotCollector bc = c.attachedRigidbody.gameObject.GetComponent <BotCollector>();
             if (bc != null)
             {
                 bc.ReceiveBots(1, transform.gameObject);
             }
             followTarget = c.attachedRigidbody.transform;
             //invent.AddBot();
         }
     }
     else if (c.gameObject.CompareTag("BotPart") && botMode == BotMode.Follow)
     {
         BotPart botPart = c.GetComponent <BotPart>();
         if (botPart != null)
         {
             GameObject bot = botPart.GetParentBot();
             if (bot != null)
             {
                 BotMovement botScript = bot.GetComponent <BotMovement>();
                 if (botScript != null)
                 {
                     BumpBot(botScript);
                 }
             }
         }
     }
 }
예제 #8
0
 // Resets the space to be ready for next enter
 private void OnTriggerExit(Collider other)
 {
     player     = null;
     inCollider = false;
 }