Ejemplo n.º 1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.tag == "Plant")
        {
            if (XCI.GetAxis(XboxAxis.RightTrigger) > 0.1f)
            {
                if (elementController.IsSelectedElementRain())
                {
                    // Debug.Log("X pressed");
                    // Check selected element controller

                    other.GetComponent <Plant>().GiveWater();
                }
                if (elementController.IsSelectedElementSunlight())
                {
                    // Check selected element controller

                    other.GetComponent <Plant>().GiveSunlight();
                }
                if (elementController.IsSelectedElementTime())
                {
                    // Check selected element controller

                    if (other.GetComponent <Plant>().GetCanRespondToTime())
                    {
                        plantManager.ChangePlantStage(other.gameObject);
                    }
                }
            }
        }
    }