void Awake()
 {
     cameraShakeScript = Camera.main.GetComponent<ScriptCameraShake>();
     lookAtScript = Camera.main.GetComponent<ScriptLookAtTarget>();
     fadeScript = Camera.main.GetComponent<ScriptScreenFade>();
     splatterScript = Camera.main.GetComponent<ScriptSplatter>();
 }
Esempio n. 2
0
 void Awake()
 {
     cameraShakeScript = Camera.main.GetComponent <ScriptCameraShake>();
     lookAtScript      = Camera.main.GetComponent <ScriptLookAtTarget>();
     fadeScript        = Camera.main.GetComponent <ScriptScreenFade>();
     splatterScript    = Camera.main.GetComponent <ScriptSplatter>();
 }
 public void Awaken()
 {
     playerLookAtScript = this.gameObject.GetComponent<ScriptLookAtTarget>();
     cameraShakeScript = Camera.main.GetComponent<ScriptCameraShake>();
     cameraLookAtScript = Camera.main.GetComponent<ScriptLookAtTarget>();
     fadeScript = Camera.main.GetComponent<ScriptScreenFade>();
     splatterScript = Camera.main.GetComponent<ScriptSplatter>();
 }
    void Awake()
    {
        cameraShakeScript = Camera.main.GetComponent<ScriptCameraShake>();
        lookAtScript = Camera.main.GetComponent<ScriptLookAtTarget>();
        fadeScript = Camera.main.GetComponent<ScriptScreenFade>();
        splatterScript = Camera.main.GetComponent<ScriptSplatter>();

        mainCamera = GameObject.Find("Main Camera");
    }
Esempio n. 5
0
    /// <summary>
    /// @Author Marshall Mason & Mike Dobson
    /// </summary>
    IEnumerator FacingEngine()
    {
        ScriptLookAtTarget lookScript = Camera.main.GetComponent <ScriptLookAtTarget>();

        foreach (ScriptFacings facing in facings)
        {
            Debug.Log(facing);
            switch (facing.facingType)
            {
            case FacingTypes.LOOKAT:

                //Do the facing action
                lookAtScript.Activate(facing.rotationSpeed, facing.targets, facing.lockTimes);
                //Wait for the specified amount of time on the facing waypoint
                yield return(new WaitForSeconds(facing.rotationSpeed[0] + facing.rotationSpeed[1] + facing.lockTimes[0]));

                break;

            case FacingTypes.WAIT:

                //Waits for the specified amount of time
                yield return(new WaitForSeconds(facing.facingTime));

                break;

            case FacingTypes.LOOKCHAIN:

                //Do the facing action
                lookAtScript.Activate(facing.rotationSpeed, facing.targets, facing.lockTimes);
                //Wait for the specified amount of time on the facing waypoint
                float waitTime = 0;
                for (int i = 0; i < facing.targets.Length; i++)
                {
                    waitTime += facing.rotationSpeed[i];
                    waitTime += facing.lockTimes[i];
                }
                waitTime += facing.rotationSpeed[facing.rotationSpeed.Length - 1];
                yield return(new WaitForSeconds(waitTime));

                break;

            case FacingTypes.FREELOOK:

                break;

            default:
                ScriptErrorLogging.logError("Invalid movement type!");
                break;
            }
        }
    }
Esempio n. 6
0
    /// <summary>
    /// @Author Marshall Mason & Mike Dobson
    /// </summary>
    IEnumerator FacingEngine()
    {
        ScriptLookAtTarget lookScript = Camera.main.GetComponent <ScriptLookAtTarget>();

        foreach (ScriptWaypoints facing in facings)
        {
            Debug.Log(facing.facingType);
            switch (facing.facingType)
            {
            case FacingTypes.LOOKAT:
                if (facing.targets != null && facing.facingTimes[0] > 0 && facing.holdTimes[0] > 0 && facing.facingTimes[1] > 0)
                {
                    //Do the facing action
                    lookScript.targets     = facing.targets;
                    lookScript.rotateSpeed = facing.facingTimes;
                    lookScript.lockTime    = facing.holdTimes;
                    //Wait for the specified amount of time on the facing waypoint
                    yield return(new WaitForSeconds(facing.facingTimes[0] + facing.facingTimes[1] + facing.holdTimes[0]));
                }
                else
                {
                    ScriptErrorLogging.logError("Look At was skipped due to missing element");
                }
                break;

            case FacingTypes.WAIT:
                if (facing.facingTimes[0] > 0)
                {
                    //Waits for the specified amount of time
                    yield return(new WaitForSeconds(facing.facingTimes[0]));
                }
                else
                {
                    ScriptErrorLogging.logError("Facing Wait was skipped due to missing element");
                }
                break;

            case FacingTypes.LOOKCHAIN:
                if (facing.targets.Length >= facing.holdTimes.Length && facing.facingTimes.Length > facing.holdTimes.Length)
                {
                    //Do the facing action
                    lookScript.targets     = facing.targets;
                    lookScript.rotateSpeed = facing.facingTimes;
                    lookScript.lockTime    = facing.holdTimes;
                    //Wait for the specified amount of time on the facing waypoint
                    float waitTime = 0;
                    for (int i = 0; i < facing.targets.Length; i++)
                    {
                        waitTime += facing.facingTimes[i];
                        waitTime += facing.holdTimes[i];
                    }
                    waitTime += facing.facingTimes[facing.targets.Length];
                    yield return(new WaitForSeconds(waitTime));
                }
                else
                {
                    ScriptErrorLogging.logError("Entire Look Chain was skipped due to missing element.");
                }
                break;

            default:
                ScriptErrorLogging.logError("Invalid movement type!");
                break;
            }
        }
    }