示例#1
0
 void Start()
 {
     gplay      = GameObject.Find("SceneManager(Clone)").GetComponent <GPlayclass>();
     childrenTr = GetComponentsInChildren <Transform>();
     thisBox    = GetComponent <BoxCollider2D>();
     textColor  = childrenTr[1].GetComponent <TextMesh>();
 }
示例#2
0
 static void CheckAchievement()
 {
     if (buttons.Count == 7)
     {
         GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQBw");
     }
 }
示例#3
0
文件: log.cs 项目: ricky395/Alieniced
 void Start()
 {
     logObjects   = GetComponentsInChildren <Transform>();
     gPlay        = GameObject.Find("SceneManager(Clone)").GetComponent <GPlayclass>();
     thisBox      = GetComponent <BoxCollider2D>();
     achievements = GameObject.Find("achievements").GetComponent <ShowAchievements>();
 }
示例#4
0
 void deleteSavedData()
 {
     lvlmanager.lastUnlockedlvl = 0;
     EndGameVariables.UpdateData("");
     GPlayclass.UpdateCloudLevel(0);
     GPlayclass.UpdateTimeAndDeaths("");
 }
示例#5
0
 public void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Death")
     {
         StartCoroutine(Reset(true));
         GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQBA");
     }
 }
示例#6
0
    /// <summary>
    /// Actualiza el número de la escena actual en la variable sceneNumber
    /// </summary>
    /// <param name="level"></param>
    public void OnLevelWasLoaded()
    {
        SetScene();

        if (GPlayclass.GetIsFirstTime() && SceneManager.GetActiveScene().buildIndex == 1)
        {
            Instantiate(hand);
        }
    }
示例#7
0
    public IEnumerator OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            yield return(new WaitForSeconds(3));

            GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQAw"); //stuck achievement
        }
    }
示例#8
0
    public static void UpdateLevel()
    {
        GameObject go = GameObject.Find("SceneManager(Clone)");

        lvlManag = go.GetComponent <lvlManager>();

        Int32.TryParse(SceneManager.GetActiveScene().name, out lvlCount);
        lvlManag.UpdateLevel(lvlCount);

        GPlayclass.UpdateCloudLevel(lvlManag.lastUnlockedlvl); //almacena el numero del nivel en una variable que es guardada en la nube
    }
示例#9
0
    void UpdateTimer()
    {
        timeText.text = ConvertSecsToString(timeInSec);

        if (countDown)
        {
            timeInSec--;
        }

        else
        {
            timeInSec++;
        }

        if (countDown && timeInSec == 9)
        {
            watch.color    = Color.red;
            timeText.color = Color.red;
            ChangeToColor(red);
        }

        if (countDown && timeInSec < 0)
        {
            timerActive = false;
            GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQCA");
            StartCoroutine(DeathScript.Reset(false));
        }

        if (timeInSec > 3599)
        {
            StartCoroutine(DeathScript.Reset(false));
        }

        if (timeInSec == 180)
        {
            GPlayclass.UpdateEvent("CgkI-Meyi84DEAIQCQ", 1);
        }

        else if (timeInSec == 360)
        {
            GPlayclass.UpdateEvent("CgkI-Meyi84DEAIQCQ", 2);
        }
    }
示例#10
0
    public void UnlockNextPack(int sceneNo)
    {
        bool exists = false;

        for (int i = 0; i < playedCount; i++)
        {
            if (playedMaps[i] == sceneNo)
            {
                exists = true;
            }
        }
        if (playedCount + 1 != playedMaps.Length)
        {
            playedMaps[playedCount++] = sceneNo;
        }

        if (!exists && (currentPNo * lvlCount) + sceneNo > lastUnlockedlvl)
        {
            lastUnlockedlvl++;
        }

        if (lastUnlockedlvl >= 20)
        {
            GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQAA");
        }
        if (lastUnlockedlvl >= 40)
        {
            GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQAQ");
        }
        if (lastUnlockedlvl >= 60)
        {
            GPlayclass.UnlockAchievement("CgkI-Meyi84DEAIQAg");
        }

        GPlayclass.UpdateCloudLevel(lastUnlockedlvl); //almacena el numero de nivel en una variable de la nube
    }
示例#11
0
 /// <summary>
 /// Comprueba si los datos pertenecen a un nuevo nivel o a uno antiguo
 /// </summary>
 /// <returns></returns>
 static bool IsNewLevel()
 {
     return((lvlmanager.lastUnlockedlvl - 1) * CharsPerLevel >= data.Length && (GPlayclass.GetLevel() == (currentPack * lvlManager.lvlCount) + currentLvl));
 }
示例#12
0
 /// <summary>
 /// Actualiza el string de datos en la variable de la nube
 /// </summary>
 static void UpdateCloudData()
 {
     GPlayclass.UpdateTimeAndDeaths(data);
 }
示例#13
0
    /// <summary>
    /// El Update se encarga del movimiento del personaje y de comprobar si ha llegado a la meta
    /// </summary>
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            GameEnded();
        }

        if (isMovActive && infoNotActive)
        {
            timeMoving = 0;
            PosUpdate();
            AnimationPlay(false);

            if (Input.GetKeyDown(KeyCode.D))
            {
                playerDir = Direction.rightMov;
                setMov(false);
            }

            else if (Input.GetKeyDown(KeyCode.W))
            {
                playerDir = Direction.upMov;
                setMov(false);
            }

            else if (Input.GetKeyDown(KeyCode.S))
            {
                playerDir = Direction.downMov;
                setMov(false);
            }

            else if (Input.GetKeyDown(KeyCode.A))
            {
                playerDir = Direction.leftMov;
                setMov(false);
            }
        }

        else
        {
            AnimationPlay(true);
            GetObstacle();
            count      += Time.deltaTime;
            timeMoving += Time.deltaTime;

            if (count > timeToGo)
            {
                if (playerDir == Direction.rightMov)
                {
                    //rb.velocity = new Vector2(speed, 0);
                    tr.position = new Vector3(tr.position.x + space, tr.position.y);
                }

                else if (playerDir == Direction.upMov)
                {
                    //rb.velocity = new Vector2(0, speed);
                    tr.position = new Vector3(tr.position.x, tr.position.y + space);
                }

                else if (playerDir == Direction.downMov)
                {
                    //rb.velocity = new Vector2(0, -speed);
                    tr.position = new Vector3(tr.position.x, tr.position.y - space);
                }

                else if (playerDir == Direction.leftMov)
                {
                    //rb.velocity = new Vector2(-speed, 0);
                    tr.position = new Vector3(tr.position.x - space, tr.position.y);
                    GPlayclass.UpdateEvent("CgkI-Meyi84DEAIQCg", 1);
                }
                count = 0;
            }
        }
    }
示例#14
0
 void DelObject()
 {
     GPlayclass.DisableFirstTime();
     Destroy(this.gameObject);
 }