Ejemplo n.º 1
0
    void Vacuum(VacuumController target)
    {
//		hit.collider.gameObject.GetComponent<VacuumController>().wasHitVac = true;
        vacuumStarting.Play();

//		hit.collider.gameObject.GetComponent<VacuumController> ().inControl = true;
        nearVacuum = true;
        gameObject.SetActive(false);
        Vector3 spawnPoint = transform.position;

        spawnPoint.y      += 0.6f;
        transform.position = spawnPoint;
    }
Ejemplo n.º 2
0
    void OnInteract()
    {
        if (!isEnabled)
        {
            return;
        }

        if (pCon.CurrentHandheldObject != null && pCon.CurrentHandheldObject.CompareTag("Plant"))
        {
            latestTree = pCon.CurrentHandheldObject;
        }

        switch (tutStep)
        {
        case 0:
            if (pCon.CurrentHandheldObject.CompareTag("Plant"))
            {
                ToggleTutCanvas(0, 1);
                tutManager.plantBoxArrow.SetActive(false);
                tutStep++;
            }
            break;

        case 1:
            if (pCon.CurrentHandheldObject == null)
            {
                ToggleTutCanvas(1, 2);
                tutManager.bucketArrow.SetActive(true);
                tutStep++;
            }
            break;

        case 2:
            if (pCon.CurrentHandheldObject.CompareTag("Bucket"))
            {
                //ToggleTutCanvas(2, 3);
                tutManager.bucketArrow.SetActive(false);
                tutManager.pondArrow.SetActive(true);
                tutStep++;
            }
            break;

        case 3:
            if (pCon.CurrentHandheldObject.CompareTag("Bucket"))
            {
                if (pCon.CurrentHandheldObject.GetComponent <BucketController>().IsFilled)
                {
                    tutManager.pondArrow.SetActive(false);
                    tutManager.SetupTreeArrow(latestTree.transform);
                    tutStep++;
                }
            }
            break;

        case 4:
            if (pCon.CurrentHandheldObject.CompareTag("Bucket"))
            {
                if (!pCon.CurrentHandheldObject.GetComponent <BucketController>().IsFilled)
                {
                    tutManager.DeactivateTreeArrow();
                }

                if (pCon.CurInteractObject != null && pCon.CurInteractObject.GetComponent <TreeControl>().IsGrowing)
                {
                    ToggleTutCanvas(2, 3);
                    tutManager.SetupTreeArrow(pCon.CurInteractObject.transform);
                    tutManager.fertBagArrow.SetActive(true);
                    tutStep++;
                }
            }
            break;

        case 5:
            if (pCon.CurrentHandheldObject.CompareTag("FertilizerBag"))
            {
                tutManager.fertBagArrow.SetActive(false);
                tutStep++;
            }
            break;

        case 6:
            if (pCon.CurInteractObject.GetComponent <TreeControl>().growBar.GetBagCount() > 0)
            {
                tutManager.fertBagArrow.SetActive(false);
                tutManager.DeactivateTreeArrow();
                tutCanvas.transform.GetChild(3).gameObject.SetActive(false);
                tutStep++;
                tutManager.LookForPoop(this);
            }
            break;

        case 8:
            if (pCon.CurrentHandheldObject.CompareTag("Vacuum"))
            {
                vCon = pCon.CurrentHandheldObject.GetComponent <VacuumController>();
                tutManager.vacArrow.SetActive(false);
                ToggleTutCanvas(4, 5);
                tutStep++;
            }
            break;

        case 9:
            if (vCon.IsVacuuming)
            {
                ToggleTutCanvas(5, 4);
                tutStep++;
            }
            break;

        case 12:
            if (pCon.CurInteractObject.CompareTag("Station"))
            {
                sCon = pCon.CurInteractObject.GetComponent <StationController>();
                if (sCon.PoopPercent > sCon.BatchAmount)
                {
                    tutManager.FertAddPoop.SetActive(false);
                    tutStep++;
                }
            }
            break;

        case 13:
            if (pCon.CurInteractObject.CompareTag("Station"))
            {
                if (sCon.WaterFillPercent > 0)
                {
                    tutCanvas.transform.GetChild(6).gameObject.SetActive(false);
                    tutManager.fertStationArrow.SetActive(false);
                    tutManager.FertAddWater.SetActive(false);
                    tutStep++;
                }
            }
            break;

        default:
            break;
        }
    }