예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        speedBase           = moveSpeed;
        rb                  = GetComponent <Rigidbody2D>();
        myColl              = GetComponent <Collider2D>();
        anim                = GetComponent <Animator>();
        sprRenderer         = GetComponent <SpriteRenderer>();
        soundWalk           = GetComponentInChildren <SoundWalk>();
        audioJump           = GetComponent <AudioSource>();
        isDead              = false;
        rb.bodyType         = RigidbodyType2D.Dynamic;
        myColl.enabled      = true;
        sprRenderer.enabled = true;
        canMove             = true;
        isArmored           = false;
        gController         = GameControllerTotal.gameControl;

        stageControl = GameObject.FindObjectOfType <StageControl>();

        if (!stageControl.debugMode)
        {
            if (gController.mobile)
            {
                joystick = GameObject.FindObjectOfType <FixedJoystick>();
            }
        }
        else
        {
            joystick = GameObject.FindObjectOfType <FixedJoystick>();
        }
    }
 public void OnPlayerDeath(string value)
 {
     scoreEnd = timeGame;    //score end es para sacar el valor del tiempo durado al morir
     GameControllerTotal.GetInstance().Score = scoreEnd;
     yourScoreTxt.SetActive(true);
     scoreValueTxt.SetActive(true);
     scoreValueTxt.GetComponent <Text>().text = scoreEnd.ToString("F2");
     //guarda los puntajes y reemplaza en jerarquia
     GameControllerTotal.gameControl.HighScore(stageName);
 }
    // Start is called before the first frame update
    void Start()
    {
        GameControllerTotal.gameControl.blackPanelAnim.SetTrigger("FadeIn");
        scoreText.text   = GameControllerTotal.GetInstance().Score.ToString("F2");
        mapNameText.text = GameControllerTotal.GetInstance().mapNameScored;

        //se activan los botones por si inician desactivados
        retryBtn.enabled = true;
        shareBtn.enabled = true;
        menuBtn.enabled  = true;
    }
예제 #4
0
 private void Awake()
 {
     if (GameControllerTotal.gameControl == null)
     {
         gameControl = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
 public void ClickShareButton()
 {
     AudioManager.audioManager.PlayAudio(AudioManager.audioManager.menuSelected);
     shareMessage = "Este fue mi puntaje en Fleaman's Hell: " + GameControllerTotal.GetInstance().Score.ToString("F2") + " intenta superarme!";
     StartCoroutine(TakeScreenshotAndShare());
 }