Exemplo n.º 1
0
    void OnTriggerEnter(Collider otherCollider)
    {
        GameObject  otherGameObject  = otherCollider.gameObject;
        Destination otherDestination = otherGameObject.GetComponent <Destination>();
        FlyingApp   otherFlyingApp   = otherGameObject.GetComponent <FlyingApp>();

        if (otherDestination)
        {
            if (!AtDestination)
            {
                if (timeLeftDestinationCooldown <= 0)
                {
                    ReachDestination(otherGameObject, otherDestination);
                }
            }
        }
        else if (otherFlyingApp)
        {
            MoneyAmount += otherFlyingApp.MoneyEffect;
            //
            SocialAmount    += otherFlyingApp.SocialEffect;
            HappinessAmount += otherFlyingApp.HappyEffect;
            //
            HealthAmount += otherFlyingApp.HealthEffect;
            SleepAmount  += otherFlyingApp.SleepEffect;

            if (otherFlyingApp.LeakYourData)
            {
                metaDataLost += 1;
            }

            otherGameObject.SetActive(false);
        }
    }
    void OnTriggerEnter(Collider otherCollider)
    {
        //Debug.Log("OnTriggerEnter()");
        GameObject  otherGameObject  = otherCollider.gameObject;
        Destination otherDestination = otherGameObject.GetComponent <Destination>();
        FlyingApp   otherFlyingApp   = otherGameObject.GetComponent <FlyingApp>();

        if (otherDestination)
        {
            if (!AtDestination)
            {
                if (timeLeftDestinationCooldown <= 0)
                {
                    ReachDestination(otherGameObject, otherDestination);
                }
            }
        }
        else if (otherFlyingApp)
        {
            //Debug.Log("otherFlyingApp");
            MoneyAmount += otherFlyingApp.MoneyEffect;
            //
            SocialAmount    += otherFlyingApp.SocialEffect;
            HappinessAmount += otherFlyingApp.HappyEffect;
            //
            HealthAmount += otherFlyingApp.HealthEffect;
            SleepAmount  += otherFlyingApp.SleepEffect;

            if (otherFlyingApp.LeakYourData)
            {
                metaDataLost += 1;
                Vector3 newScale = gman.transform.localScale;
                newScale.x += 1;
                newScale.y += 1;
                gman.transform.localScale = newScale;
                gman.transform.Translate(0, 0.5f, 0);
                if (metaDataLost >= 100)
                {
                    GameOver("GOV GOT YOUR DATA.");
                }
            }

            otherGameObject.SetActive(false);
        }
    }