Exemplo n.º 1
0
    public void setCurrentLightType(int type)
    {
        if (type == 0)
        {
            //Debug.Log("Returning some resource");
            float percentageReturn = timeRemaining / lightDuration;
            //Debug.Log(percentageReturn);

            if (currentLightType == 1)
            {
                pScript.addResource(pScript.light1Value * percentageReturn);
                //once it is off remove from the history (for lights away from trav that we turn on/off)
                tMovement.removeFromHistory(gameObject);
                //Debug.Log("Removed from history");
            }
            else if (currentLightType == 2)
            {
                pScript.addResource(pScript.light2Value * percentageReturn);
                //once it is off remove from the history
                tMovement.removeFromHistory(gameObject);
            }
            else if (currentLightType == 3)
            {
                pScript.addResource(pScript.light3Value * percentageReturn);
                mfController.turnOffFX();
            }
            currentLightType = type;
            //turnOffPaths();

            countDown.SetActive(false);

            return;
        }

        currentLightType = type;

        //for if the trav is at a certain light and it turns off, and we turn it on again.
        if (currentLightType == 1 || currentLightType == 2)
        {
            tMovement.removeFromHistory(gameObject);
        }
        timeRemaining = lightDuration;

        if (lampLight)
        {
            startIntensity = lampLight.intensity;
        }

        if (currentLightType == 3)
        {
            mfController.turnOnFX();
        }
    }
Exemplo n.º 2
0
    void playFire()
    {
        monsterFireController fController = GetComponentInChildren <monsterFireController>();

        if (fController == null)
        {
            Debug.Log("Could not find firecontroller");
        }
        fController.turnOnFX();

        Invoke("removeBody", 2f);
        Invoke("stopFire", 2.5f);
    }