Beispiel #1
0
    //light grows
    public void ExpandLight()
    {
        if (spotlight.spotAngle < angleMax)
        {
            spotlight.spotAngle += angleSpeed * Time.deltaTime;
        }
        if (spotlight.intensity < intensityMax)
        {
            spotlight.intensity += intensitySpeed * Time.deltaTime;
        }

        //we are going to trigger smth
        if (triggersMono && !hasActivated)
        {
            //bigger than the angle necessary to trigger?
            if (spotlight.spotAngle > angleToTrigger)
            {
                //trigger!
                monoMan.SetMonologueSystem(monoToActivate);
                monoMan.EnableMonologue();

                //set new camera as well
                if (newCamera)
                {
                    camManager.Set(newCamera);
                }

                //so we cant reactivate
                hasActivated = true;
            }
        }
    }
Beispiel #2
0
    void ActivateMono()
    {
        monoMan.SetMonologueSystem(monoIndex);

        monoMan.EnableMonologue();

        hasActivated = true;

        Debug.Log("activated mono");
    }
    IEnumerator WaitForCameraTransition()
    {
        yield return(new WaitForSeconds(1f));

        Monologue mono = allMyMonologues[currentMonologue];

        //player ref
        GameCamera cam = camManager.currentCamera;

        //currentPlayer = cam.transform.parent.gameObject;

        //unlock player
        if (mono.lockPlayer)
        {
        }

        //check for cinematic to enable
        if (mono.playsCinematic)
        {
            cineManager.allCinematics[mono.cinematic.cIndex].cPlaybackManager.StartTimeline();
        }
        //cinematic triggers to enable
        if (mono.enablesCinematicTriggers)
        {
            for (int i = 0; i < mono.cTriggers.Length; i++)
            {
                cineManager.allCinematics[mono.cTriggers[i].cIndex].cTrigger.gameObject.SetActive(true);
            }
        }


        //if this monologue repeats at finish
        if (mono.repeatsAtFinish)
        {
            //reset the monologue trigger after 3 sec
            if (mTrigger)
            {
                mTrigger.WaitToReset(5f);
            }
        }
        //disable the monologue trigger, it's done
        else
        {
            if (mTrigger)
            {
                mTrigger.gameObject.SetActive(false);
            }
        }

        //if this monologue has a new monologue to activate
        if (mono.triggersMonologues)
        {
            //enable the monologues but wait to make them usable to player
            for (int i = 0; i < mono.monologueTriggerIndeces.Length; i++)
            {
                MonologueTrigger mTrigger = wmManager.allMonologues[mono.monologueTriggerIndeces[i]].mTrigger;
                mTrigger.gameObject.SetActive(true);
                mTrigger.hasActivated = true;
                mTrigger.WaitToReset(mono.monologueWaits[i]);
            }

            //loop thru other managers to activate
            for (int i = 0; i < mono.monologueManagerIndeces.Length; i++)
            {
                //get manager
                MonologueManager otherMonoManager = wmManager.allMonoManagers[mono.monologueManagerIndeces[i]];
                //set manager to new monologue from within its list
                otherMonoManager.SetMonologueSystem(mono.monologueIndecesWithinManager[i]);
                //enable it?
                otherMonoManager.EnableMonologue();
            }
        }

        //advance scene
        if (mono.loadsScene)
        {
            scener.LoadNextScene();
        }


        inMonologue = false;
    }