Ejemplo n.º 1
0
    protected override void ExecuteAction(CharacterBehaviour character)
    {
        if (isActive)
        {
            isActive = false;

            if (robotGameObject.activeInHierarchy)
            {
                robotGameObject.SetActive(false);
                GameObject obj = Instantiate(robotItemPrefab, character.transform.position, Quaternion.identity);
                obj.GetComponent <InventoryObjectBehaviour>().inventaryCenter = inventoryCenter;
            }
            else if (machineGameObject.activeInHierarchy)
            {
                machineGameObject.SetActive(false);
                GameObject obj = Instantiate(machineItemPrefab, character.transform.position, Quaternion.identity);
                obj.GetComponent <InventoryObjectBehaviour>().inventaryCenter = inventoryCenter;
            }
            else if (dogGameObject.activeInHierarchy)
            {
                dogGameObject.SetActive(false);
                GameObject obj = Instantiate(dogItemPrefab, character.transform.position, Quaternion.identity);
                obj.GetComponent <InventoryObjectBehaviour>().inventaryCenter = inventoryCenter;
            }
            else if (lampGameObject.activeInHierarchy)
            {
                lampGameObject.SetActive(false);
                GameObject obj = Instantiate(lampItemPrefab, character.transform.position, Quaternion.identity);
                obj.GetComponent <InventoryObjectBehaviour>().inventaryCenter = inventoryCenter;
            }

            if (character && character.CheckInventaryObjectOnSelectedPosition("Robot"))
            {
                robotGameObject.SetActive(true);
            }
            else if (character && character.CheckInventaryObjectOnSelectedPosition("Machine"))
            {
                machineGameObject.SetActive(true);
            }
            else if (character && character.CheckInventaryObjectOnSelectedPosition("Lamp"))
            {
                lampGameObject.SetActive(true);
            }
            else if (character && character.CheckInventaryObjectOnSelectedPosition("Dog"))
            {
                dogGameObject.SetActive(true);
            }
        }
    }
Ejemplo n.º 2
0
 protected override void ExecuteAction(CharacterBehaviour character)
 {
     if (character && !activated && character.CheckInventaryObjectOnSelectedPosition(activatorItemName))
     {
         GameEvents.FSMEvents.StartInteraction.SafeInvoke(GameEnums.FSMInteractionEnum.ActivateItem);
         ActivateTree();
     }
 }
Ejemplo n.º 3
0
 protected override void ExecuteAction(CharacterBehaviour character)
 {
     if (character.CheckInventaryObjectOnSelectedPosition(cardName))
     {
         GameEvents.AudioEvents.TriggerSFX("InsertedKeycard", false, false);
         SetActive(false);
         GameEvents.FSMEvents.StartInteraction.SafeInvoke(GameEnums.FSMInteractionEnum.ActivateItem);
     }
 }
Ejemplo n.º 4
0
 protected override void ExecuteAction(CharacterBehaviour character)
 {
     if (character && character.CheckInventaryObjectOnSelectedPosition(cardName))
     {
         GameEvents.AudioEvents.TriggerRobotTransmission.SafeInvoke();
         GameEvents.AudioEvents.TriggerSFX.SafeInvoke("InsertedKeycard", false, false);
         GameEvents.FSMEvents.StartInteraction.SafeInvoke(GameEnums.FSMInteractionEnum.ActivateItem);
         StartCoroutine(WaitToTurnOn(1f));
     }
 }
Ejemplo n.º 5
0
 protected override void ExecuteAction(CharacterBehaviour character)
 {
     if (character && revealed && !activated && character.CheckInventaryObjectOnSelectedPosition(activatorItemName))
     {
         GameEvents.AudioEvents.TriggerSFX.SafeInvoke("Pour", false, false);
         GameEvents.FSMEvents.StartInteraction.SafeInvoke(GameEnums.FSMInteractionEnum.ActivateItem);
         dogFood.SetActive(true);
         ActivateBowl();
     }
 }
Ejemplo n.º 6
0
    protected override void ExecuteAction(CharacterBehaviour character)
    {
        if (character && character.CheckInventaryObjectOnSelectedPosition(itemName))
        {
            GameEvents.AudioEvents.TriggerSFX.SafeInvoke("PlaceSun", false, false);
            GameEvents.FSMEvents.StartInteraction.SafeInvoke(GameEnums.FSMInteractionEnum.ActivateItem);
            itemSpecial.gameObject.SetActive(true);
            itemSpecial.GetComponent <SphereCollider>().enabled = false;

            int index = 0;
            foreach (MeshRenderer renderer in objects)
            {
                PlanetMachineButtonBehaviour button = renderer.GetComponent <PlanetMachineButtonBehaviour>();
                if (button)
                {
                    button.isOn = true;
                }
                renderer.material = materials[index];
                index++;
            }
        }
    }