Пример #1
0
 void Awake()
 {
     if (mainCamera == null) {
         DontDestroyOnLoad (gameObject);
         mainCamera = this;
     } else {
         Destroy (gameObject);
     }
 }
Пример #2
0
    public override void Initialize()
    {
        camera = new PlatformCamera(Core.screen.size);

        Core.mainCamera = camera;

        Core.graphics.ClearAuto(true, Color32.black);

        testtexture = Core.resource.LoadTexture("Sprites/Blender_UV");
    }
Пример #3
0
    public override void Initialize()
    {
        camera          = new PlatformCamera(Core.screen.size);
        Core.mainCamera = camera;         // See "UnityBootstrap.Update()" method

        Core.graphics.ClearAuto(true, Color32.black);

        testtexture = Core.resource.LoadTexture("Sprites/Blender_UV");

        testmaterial = Core.resource.CreateMaterial("Sprites/Default");
        testmaterial.Set("_MainTex", testtexture);

        testmaterial2 = Core.resource.CreateMaterial("Lines/Colored Blended");

        tilemap = Core.resource.LoadTileMap("Tilemaps/Test");
    }
Пример #4
0
 /// <summary>
 /// Do the effect.
 /// </summary>
 override protected void DoEffect()
 {
     if (shakeTarget == null)
     {
         shakeTarget = gameObject;
     }
     if (!shakeStarted)
     {
         originalPosition = shakeTarget.transform.position;
     }
     shakeStarted        = true;
     currentIntensityMax = shakeAmount;
     zoneCamera          = shakeTarget.GetComponent <PlatformCamera> ();
     if (zoneCamera != null)
     {
         zoneCamera.enabled = false;
     }
     shakeTimer = 0;
 }
Пример #5
0
    IEnumerator LevelIntro()
    {
        yield return(new WaitForSeconds(1.0f));

        yield return(StartCoroutine(PlatformCamera.Get().CraneMove(posUp, 1f)));

        if (skip == true)
        {
            yield return(StartCoroutine(PlatformCamera.Get().SkipToTarget(posDown, 8f)));

            GameManager.Get().gameState = GameManager.GameStates.Playing;
            GameManager.Get().player.enabled = true;
            skip = false;
            yield return(StartCoroutine(CameraUpdate()));
        }
        yield return(new WaitForSeconds(.25f));

        yield return(StartCoroutine(PlatformCamera.Get().CraneMove(posDown, 2f)));

        GameManager.Get().gameState = GameManager.GameStates.Playing;
        GameManager.Get().player.enabled = true;
        yield return(StartCoroutine(CameraUpdate()));
    }
Пример #6
0
    IEnumerator CameraUpdate()
    {
        skip = false;
        while (true)
        {
            if (GameManager.Get().player.transform.position.y > -12.5f)
            {
                PlatformCamera.Get().GetComponent <Camera>().cullingMask = -1;
                float z = Camera.main.WorldToScreenPoint(GameManager.Get().player.transform.position).z;
                posUp.position = z > 40.0f ? new Vector3(posUp.position.x, 10.0f, posUp.position.z) : new Vector3(posUp.position.x, 5.7f, posUp.position.z);
                yield return(StartCoroutine(PlatformCamera.Get().CraneUp(posUp.position.y, 8f)));

                yield return(0);
            }
            else if (GameManager.Get().player.transform.position.y < -12.5f)
            {
                PlatformCamera.Get().GetComponent <Camera>().cullingMask = 1 << 14;
                PlatformCamera.Get().GetComponent <Camera>().cullingMask = ~PlatformCamera.Get().GetComponent <Camera>().cullingMask;
                float z = Camera.main.WorldToScreenPoint(GameManager.Get().player.transform.position).z;
                posDown.position = z > 40.0f ? new Vector3(posUp.position.x, 2.5f, posUp.position.z) : new Vector3(posUp.position.x, -2.5f, posUp.position.z);
                yield return(StartCoroutine(PlatformCamera.Get().CraneUp(posDown.position.y, 8f)));

                yield return(0);
            }
            if (GameManager.Get().player.currentArea == "Area2" &&
                GameManager.Get().player.lastArea != "Area2")
            {
                yield return(StartCoroutine(PlatformCamera.Get().Rotate(30.0f)));

                GameManager.Get().player.currentArea = "";
                yield return(0);
            }
            else if (GameManager.Get().player.currentArea == "Area1" &&
                     GameManager.Get().player.lastArea != "Area1")
            {
                yield return(StartCoroutine(PlatformCamera.Get().Rotate(315.0f)));

                GameManager.Get().player.currentArea = "";
                yield return(0);
            }
            else if (GameManager.Get().player.currentArea == "Area3" &&
                     GameManager.Get().player.lastArea != "Area3")
            {
                yield return(StartCoroutine(PlatformCamera.Get().Rotate(230.0f)));

                GameManager.Get().player.currentArea = "";
                yield return(0);
            }
            else if (GameManager.Get().player.currentArea == "Area4" &&
                     GameManager.Get().player.lastArea != "Area4")
            {
                yield return(StartCoroutine(PlatformCamera.Get().Rotate(140.0f)));

                GameManager.Get().player.currentArea = "";
                yield return(0);
            }
            else
            {
                yield return(0);
            }
        }
    }
Пример #7
0
 void Awake()
 {
     craneCam = this;
     angleOfError = 0.25f;
 }
Пример #8
0
 void Awake()
 {
     craneCam     = this;
     angleOfError = 0.25f;
 }