Пример #1
0
 public static void Hide_Static(float time)
 {
     if (instance != null)
     {
         instance.Hide(time);
     }
 }
    private void Update()
    {
        if (anim.GetCurrentAnimatorStateInfo(0).IsName("Camera_Start_Done_Boss1") || skip || anim.GetCurrentAnimatorStateInfo(0).IsName("Done"))
        {
            wall.SetActive(false);
        }

        if (anim.GetCurrentAnimatorStateInfo(0).IsName("Done"))
        {
            fade.SetActive(false);
            cam.enabled = false;
            bars.Hide(1);

            lm.enabled = true;
            levelUI.healthSliders[0].gameObject.SetActive(true);
            levelUI.healthSliders[1].gameObject.SetActive(true);
            levelUI.LevelTimer.gameObject.SetActive(true);

            //player_2.GetComponent<StateManager>().dontMove = false;
            //player_1.GetComponent<StateManager>().dontMove = false;
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            anim.SetTrigger("Skip");
            skip = true;
        }
    }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     cinematicEnd.Hide(0.4f);
     timer += Time.deltaTime;
     if (timer > timerTotStart)
     {
         Camera.main.GetComponent <Camera_Focus>().enabled = true;
         var activate = GameObject.FindGameObjectsWithTag("player");
         for (int i = 0; i < activate.Length; i++)
         {
             activate[i].GetComponent <Animator>().enabled = true;
             //activate[i].GetComponent<Player_Movement>().enabled = true;
             activate[i].GetComponent <Player_Movement>().Allow_Moving();
         }
     }
     if (timer > timerTotStart + 2.5)
     {
         boss.GetComponent <Boss>().enabled = true;
         canvas.SetActive(true);
         Destroy(this.gameObject);
     }
 }
Пример #4
0
    public void Update()
    {
        if (Load.cinematic && !GetComponent <travellingCamera>().enabled)
        {
            cinematicHide.Hide(0.4f);
            Wait();
            Load.cinematic = false;
        }


        if (update_lifeback)
        {
            if (liveDisplay.fillAmount < liveDisplay_back.fillAmount)
            {
                liveDisplay_back.fillAmount = liveDisplay_back.fillAmount - 0.05f * Time.deltaTime;
            }
            else
            {
                update_lifeback = false;
            }
        }
    }
Пример #5
0
 void DialogueCameraOff()
 {
     gameTime.paused = false;
     bars.Hide(0.4f);
     bars.StartCoroutine("ZoomOut");
 }
Пример #6
0
    private void Update()
    {
        BehaviorCamera();
        for (int i = 0; i < players_gm.Count; i++)
        {
            players_gm[i].godMode = true;
        }
        if (laser != null)
        {
            laser.SetActive(false);
        }

        if (camera.transform.position.y >= transform.position.y + offset)
        {
            startPosX = transform.position.x;
            startPosY = transform.position.y;

            cameraShake = ShakeSprite();
            StartCoroutine(cameraShake);

            sprite_Renderer.material = flash_sprite;
            if (transform.localScale.x >= limitScale_Boss)
            {
                transform.position   = new Vector3(transform.position.x, transform.position.y - Time.deltaTime * 2, transform.position.z);
                transform.localScale = new Vector3(transform.localScale.x - Time.deltaTime * scale_Speed, transform.localScale.y - Time.deltaTime * scale_Speed, transform.localScale.z);
            }
            else
            {
                sprite_Renderer.material = default_sprite;

                StopCoroutine(cameraShake);


                camera.enabled = true;
                canvas.SetActive(true);

                for (int i = 0; i < players.Count; i++)
                {
                    players[i].GetComponent <Animator>().enabled = true;
                    players[i].enabled = true;
                    players[i].Allow_Moving();
                }

                foreach (Collider2D c in GetComponents <Collider2D>())
                {
                    Destroy(c);
                }

                CapsuleCollider2D collider = gameObject.AddComponent <CapsuleCollider2D>();
                collider.size   = new Vector2(10, 10);
                collider.offset = new Vector2(0.1334858f, -1.468382f);

                ropeCollisions.gameObject.SetActive(true);
                //Change here
                ropeCollisions.enabled = true;

                cinematicDie.Hide(0.001f);

                AnalyticsEvent.Custom("Boss Completed", new Dictionary <string, object>
                {
                    { "Scene", SceneManager.GetActiveScene().name },
                    { "Room", transform.name }
                });

                Destroy(this);
            }
        }
    }