Inheritance: MonoBehaviour
Esempio n. 1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         TutorialText.ChangeText("");
     }
 }
Esempio n. 2
0
        void ReleaseDesignerOutlets()
        {
            if (TutorialText != null)
            {
                TutorialText.Dispose();
                TutorialText = null;
            }

            if (TutorialView != null)
            {
                TutorialView.Dispose();
                TutorialView = null;
            }

            if (StartCheck != null)
            {
                StartCheck.Dispose();
                StartCheck = null;
            }

            if (FinishButton != null)
            {
                FinishButton.Dispose();
                FinishButton = null;
            }
        }
Esempio n. 3
0
    public void OnWinWave()
    {
        if (isWaitDeadButton)
        {
            return;
        }
        upgrader.Shuffle();

        mainText.text  = "Wave complete!\n\n";
        mainText.text += "Select upgrade:\n\n";

#if VR_VERSION
        mainText.text += $"(A) {upgrader.data[0].name} - {upgrader.data[0].description}\n\n";
        mainText.text += $"(B) {upgrader.data[1].name} - {upgrader.data[1].description}\n\n";
        mainText.text += $"(C) {upgrader.data[2].name} - {upgrader.data[2].description}\n\n";
#else
        mainText.text += $"(1) {upgrader.data[0].name} - {upgrader.data[0].description}\n\n";
        mainText.text += $"(2) {upgrader.data[1].name} - {upgrader.data[1].description}\n\n";
        mainText.text += $"(3) {upgrader.data[2].name} - {upgrader.data[2].description}\n\n";
#endif

        isWaitForUpgrade = true;

        TutorialText t = tutorials[currTutorial];
        objectiveText.text = string.IsNullOrEmpty(t.textObjective) ? "  " : t.textObjective.Replace("\\n", "\n") + spawner.GetProgressStr();

        DelayedWaveStart(20.0f);
    }
Esempio n. 4
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 5
0
        void ReleaseDesignerOutlets()
        {
            if (TutorialText != null)
            {
                TutorialText.Dispose();
                TutorialText = null;
            }

            if (TutorialView != null)
            {
                TutorialView.Dispose();
                TutorialView = null;
            }

            if (SkipButton != null)
            {
                SkipButton.Dispose();
                SkipButton = null;
            }

            if (ContinueButton != null)
            {
                ContinueButton.Dispose();
                ContinueButton = null;
            }
        }
Esempio n. 6
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            TutorialText tutorial = collision.GetComponentInChildren <TutorialText>();
            switch (tutorialType)
            {
            case TUTORIAL_TYPE.ORB:
                if (tutorial)
                {
                    tutorial.ChangeTutorialTo(TutorialText.TUTORIAL_STATE.ORB);
                }
                break;

            case TUTORIAL_TYPE.ATTACK:
                if (tutorial.orbTutorialEnd)
                {
                    tutorial.ChangeTutorialTo(TutorialText.TUTORIAL_STATE.ATTACK);
                    Destroy(this.gameObject);
                }
                break;

            default:
                break;
            }
        }
    }
Esempio n. 7
0
 public void Launch()
 {
     tutorialText = JsonUtility.FromJson <TutorialText>(tutorialJSON.text);
     step         = ETutorialStep.TELESCOPE_MOVE;
     tutorialUIAnimator.SetTrigger("Start");
     StartCoroutine(UpdateStep());
 }
Esempio n. 8
0
    public static void ShowTutorial(string s)
    {
        TutorialText tt = GameObject.FindObjectOfType <TutorialText>();

        tt.displayTime = 3f;
        tt.Text.text   = s;
        tt.cg.alpha    = 1;
    }
Esempio n. 9
0
    IEnumerator ShowWaitTap(TutorialText tText, string s1, string s2)
    {
        yield return(StartCoroutine(tText.Show(s1, s2)));

        yield return(StartCoroutine(WaitForTap()));

        yield return(StartCoroutine(tText.Hide()));
    }
 private void Awake()
 {
     for (int i = 0; i < TutorialObj.Length; i++)
     {
         EventTirgger.Add(false);
     }
     TutorialTextCS = TutorialText.GetComponent <TutorialText>();
     cnt            = 0;
 }
    void Start()
    {
        GS.a = defSettings;
        CardHandler.s.enabled = false;
        CardHandler.s.DeleteCards();

        tut = TutorialText.s;

        StartCoroutine(Stage1());
    }
Esempio n. 12
0
 private void OnTriggerStay(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         TutorialText.ChangeText("Press E to pick up Item");
         if (Input.GetKey(KeyCode.E))
         {
             other.gameObject.GetComponent <PlayerInventoryManager>().OnPickup(this.gameObject, this.item);
         }
     }
 }
Esempio n. 13
0
    public void SpawnText(string whatToSay)
    {
        GameObject text = Instantiate(tutorialPrefab);

        if (currentText != null)
        {
            currentText.CleanupText();
        }
        currentText = text.GetComponent <TutorialText> ();
        currentText.Say(whatToSay);
    }
Esempio n. 14
0
 // Update is called once per frame
 void Update()
 {
     if (isTutorialGuideRunning)
     {
         if (isEqualVector3(transform.position, positions[TutorialController.currentTutorialStep]))
         {
             if (TutorialController.currentTutorialStep == 0)
             {
                 isTutorialGuideRunning = false;
                 TutorialText.turnOnScript();
                 TutorialController.isNext = true;
             }
             else if (TutorialController.currentTutorialStep == 1)
             {
                 TutorialController.isPlay = true;
             }
         }
         else
         {
             if (TutorialController.currentTutorialStep == 0)
             {
                 moveToLocation(transform.position, positions[TutorialController.currentTutorialStep], 1f);
             }
             else if (TutorialController.currentTutorialStep == 1)
             {
                 moveToLocation(transform.position, positions[TutorialController.currentTutorialStep], 3f);
             }
             else if (TutorialController.currentTutorialStep == 2)
             {
                 moveToLocation(transform.position, positions[TutorialController.currentTutorialStep], 1f);
             }
             else if (TutorialController.currentTutorialStep == 3 || (TutorialController.currentTutorialStep > 4 && TutorialController.currentTutorialStep < 8))
             {
                 moveToLocation(tutorialGuide.transform.position, submarine.transform.position + new Vector3(-1.86f, 5.5f, -12.72f), 3f);
             }
             else if (TutorialController.currentTutorialStep == 4) // 5 can be ignored.
             {
                 moveToLocation(tutorialGuide.transform.position, submarine.transform.position + new Vector3(6.7f, 5.5f, 1.36f), 3f);
             }
             else if (TutorialController.currentTutorialStep == 8)
             {
                 moveToLocation(transform.position, positions[TutorialController.currentTutorialStep], 1f);
             }
             else if (TutorialController.currentTutorialStep == 9)
             {
                 moveToLocation(transform.position, positions[TutorialController.currentTutorialStep], 1f);
             }
         }
     }
 }
Esempio n. 15
0
    IEnumerator FailInstructions()
    {
        TutorialText tText = GameObject.Find("TutorialText").GetComponentInChildren <TutorialText> ();

        yield return(StartCoroutine(tText.Hide()));

        SocialManager.Instance.UnlockAchievement("breakin the law");

        yield return(StartCoroutine(ShowWaitTap(tText, "not going to follow intructions?", "")));

        yield return(StartCoroutine(ShowWaitTap(tText, "maybe you don't need a tutorial...", "")));

        yield return(StartCoroutine(ShowWaitTap(tText, "...so good luck!", "(tap to start the game)")));

        FadeCam.Instance.FadeOut(() => { Application.LoadLevel("game"); });
    }
    void SetupTutorialTexts()
    {
        for (int i = 0; i < tutorialText.Length; i++)
        {
            TutorialText tt     = tutorialText[i];
            string       posKey = "";

            /*foreach(AxisData ad in axisData){
             *      if(ad.name == tt.name){
             *              posKey = ad.posButton;
             *              break;
             *      }
             * }*/
            tt.labelText         = tt.labelText;    // + posKey;
            tt.controlLabel.text = tt.labelText;
        }
    }
Esempio n. 17
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        tutorialText = GetNode <TutorialText>("CanvasLayer/TutorialText");
        player       = GetNode <Player>("Map/Player");
        scoreText    = GetNode <Label>("CanvasLayer/ScoreHUD/ScoreText");
        player.State = PlayerState.Idle;
        var fadeRect = GetNode <ColorRect>("CanvasLayer/Z/FadeRect");

        fadeRect.Visible = true;
        var fadeAnim = fadeRect.GetNode <AnimationPlayer>("AnimationPlayer");

        fadeAnim.Play("FadeIn");

        Sfx = GetNode <SFX>("SFX");

        ShowTutorialText("Find the shovel!");
    }
Esempio n. 18
0
    public static GameObject ShowText(string name, string text, float time, TextAlignment alignment, TextAnchor anchor, float x, float y)
    {
        LoadFonts();

        // Destroy old object if existent
        GameObject textObject = GameObject.Find(PREFIX + name);

        MonoBehaviour.Destroy(textObject);

        textObject = new GameObject(PREFIX + name);

        textObject.AddComponent <OutlineText>().thickness = 2;

        TutorialText textBehaviour = textObject.GetComponent <TutorialText>();

        if (textBehaviour == null)
        {
            textBehaviour = textObject.AddComponent <TutorialText>();
        }

        GUIScale textScaler = textObject.GetComponent <GUIScale>();
        GUIText  guitext    = textObject.GetComponent <GUIText>();

        guitext.enabled = true;

        textObject.transform.position = new Vector3(x, y, 0);

        guitext.text      = text;
        guitext.anchor    = anchor;
        guitext.alignment = alignment;
        //guitext.font = bigFont;
        //guitext.material = bigMat;
        //guitext.fontSize = 48;

        if (time > 0)
        {
            textBehaviour.DestroyIn(time);
        }

        return(textObject);
    }
Esempio n. 19
0
    void ProcessTutorial()
    {
        if (currTutorial != 0 && tutorials[currTutorial - 1].arrowObj != null && tutorials[currTutorial - 1].arrowObj.Length != 0)
        {
            foreach (var arrow in tutorials[currTutorial - 1].arrowObj)
            {
                arrow.gameObject.SetActive(false);
            }
        }

        TutorialText t = tutorials[currTutorial];

        mainText.text      = string.IsNullOrEmpty(t.textMain) ? "  " : t.textMain.Replace("\\n", "\n");
        objectiveText.text = string.IsNullOrEmpty(t.textObjective) ? "  " : t.textObjective.Replace("\\n", "\n");

        mainText.text      = mainText.text.Replace(@"'A'", @"'1'");
        mainText.text      = mainText.text.Replace("\"A\"", @"'1'");
        objectiveText.text = objectiveText.text.Replace(@"'A'", @"'1'");

        if (currTutorial == 8)
        {
            objectiveText.text += $"({killedAsteroids} / {neededAsteroids})";
        }
        if (currTutorial == 9)
        {
            objectiveText.text += spawner.GetProgressStr();
        }

        if (t.arrowObj != null && t.arrowObj.Length != 0)
        {
            foreach (var arrow in t.arrowObj)
            {
                arrow.gameObject.SetActive(true);
            }
        }
        if (t.toEnable != null)
        {
            t.toEnable.SetActive(true);
        }
    }
Esempio n. 20
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (!player)
     {
         if (collision.tag == "Player")
         {
             player = collision.gameObject;
         }
     }
     else
     {
         if (collision.tag == "Player")
         {
             if (player != collision.gameObject)
             {
                 TutorialText tutorial = collision.GetComponentInChildren <TutorialText>();
                 tutorial.ChangeTutorialTo(TutorialText.TUTORIAL_STATE.ORB);
                 Destroy(this.gameObject);
             }
         }
     }
 }
Esempio n. 21
0
    public void OnAsteroidDie()
    {
        if (currTutorial != 8)
        {
            if (tutorials[currTutorial].arrowObj != null && tutorials[currTutorial].arrowObj.Length != 0)
            {
                foreach (var arrow in tutorials[currTutorial].arrowObj)
                {
                    arrow.gameObject.SetActive(false);
                }
            }

            for (; currTutorial < 8; ++currTutorial)
            {
                if (tutorials[currTutorial].toEnable)
                {
                    tutorials[currTutorial].toEnable.SetActive(true);
                }
            }

            currTutorial = 8;
            ProcessTutorial();
        }

        ++killedAsteroids;

        TutorialText t = tutorials[currTutorial];

        objectiveText.text = string.IsNullOrEmpty(t.textObjective) ? "  " : t.textObjective.Replace("\\n", "\n") + $"({killedAsteroids}/{neededAsteroids})";

        if (neededAsteroids == killedAsteroids)
        {
            LeanTween.delayedCall(1.0f, () => {
                ++currTutorial;
                ProcessTutorial();
                DelayedWaveStart(5.0f);
            });
        }
    }
Esempio n. 22
0
    public void OnWinGame()
    {
        if (isWaitDeadButton)
        {
            return;
        }
        mainText.text  = "You Win!\n\n";
        mainText.text += $"Find easter egs: {openedAchievments}/{textsAchievment.Length + 2}\n";
        mainText.text += $"Lasers fired: {playerWeapon.shootedProjectiles}\n";
        mainText.text += $"Distance traveled: {(player.movedDist / 1000).ToString("0.00")}km\n";
        mainText.text += $"Enemies killed: {spawner.killedEnemies}\n";

#if VR_VERSION
        mainText.text += "\n\nPress 'A' to play again";
#else
        mainText.text += "\n\nPress '1' to play again";
#endif

        TutorialText t = tutorials[currTutorial];
        objectiveText.text = string.IsNullOrEmpty(t.textObjective) ? "  " : t.textObjective.Replace("\\n", "\n") + spawner.GetProgressStr();

        isWaitDeadButton = true;
    }
Esempio n. 23
0
    void Awake()
    {
        Var.Mng = this;
        int Slot = PlayerPrefs.GetInt("LoadedSlot");

        if (PlayerPrefs.HasKey("NewGame") == true)
        {
            Var.Mems.Clear();
            Var.Money         = 25;
            Var.Fame          = 100;
            Var.Semester      = 0;
            Var.PjStan        = 8;
            Var.MenuActivated = true;

            if (PlayerPrefs.GetInt("PassTuto") == 1)
            {
                Var.TutorialPass = true;
            }
            else if (PlayerPrefs.GetInt("PassTuto") == 0)
            {
                Var.TutorialPass = false;
            }

            PlayerPrefs.DeleteKey("PassTuto");

            if (Var.TutorialPass == false)
            {
                Var.OnTutorial = true;
                Tutorial       = Instantiate(TutorialPrefab) as TutorialText;
                WallInstance   = Instantiate(WallPrefab, new Vector3(WallPrefab.transform.position.x, WallPrefab.transform.position.y, -2), Quaternion.identity) as Wall;
            }
        }
        else
        {
            Var.Year  = PlayerPrefs.GetInt("Slot" + Slot + "Year");
            Var.Month = PlayerPrefs.GetInt("Slot" + Slot + "Month");

            if (PlayerPrefs.GetInt("Slot" + Slot + "Day") == 1)
            {
                Var.Day = "초";
            }
            else if (PlayerPrefs.GetInt("Slot" + Slot + "Day") == 2)
            {
                Var.Day = "중";
            }
            else
            {
                Var.Day = "말";
            }

            if (PlayerPrefs.GetInt("Slot" + Slot + "MenuActivated") == 1)
            {
                Var.MenuActivated = true;
            }

            Var.Money    = PlayerPrefs.GetFloat("Slot" + Slot + "Money");
            Var.Fame     = PlayerPrefs.GetInt("Slot" + Slot + "Fame");
            Var.Semester = PlayerPrefs.GetInt("Slot" + Slot + "Semester");
            Var.PjStan   = PlayerPrefs.GetInt("Slot" + Slot + "PjStan");

            Debug.Log("Loaded Member Number is " + PlayerPrefs.GetInt("Slot" + Slot + "Members"));

            Var.MaleNameList.Clear();
            int MaleNameCount = 0;
            while (PlayerPrefs.HasKey("Slot" + Slot + "MaleName" + MaleNameCount) == true)
            {
                Var.MaleNameList.Add(System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(PlayerPrefs.GetString("Slot" + Slot + "MaleName" + MaleNameCount))));
                MaleNameCount += 1;
            }
            Var.FemaleNameList.Clear();
            int FemaleNameCount = 0;
            while (PlayerPrefs.HasKey("Slot" + Slot + "FemaleName" + FemaleNameCount) == true)
            {
                Var.FemaleNameList.Add(System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(PlayerPrefs.GetString("Slot" + Slot + "FemaleName" + FemaleNameCount))));
                FemaleNameCount += 1;
            }

            for (int i = 0; i < PlayerPrefs.GetInt("Slot" + Slot + "Members"); i++)
            {
                NewMember = Instantiate(NewMemPf, new Vector3(Random.Range(-1.5f, 1.8f), Random.Range(-0.7f, 1.2f), NewMemPf.transform.position.z), Quaternion.identity) as Character;
                NewMember.SetPosition();
                NewMember.Loaded = true;

                NewMember.Name = System.Text.Encoding.UTF8.GetString(System.Convert.FromBase64String(PlayerPrefs.GetString("Slot" + Slot + "Name" + i)));

                NewMember.Abilities[0] = (PlayerPrefs.GetInt("Slot" + Slot + "Plan" + i));
                NewMember.Abilities[1] = (PlayerPrefs.GetInt("Slot" + Slot + "Programming" + i));
                NewMember.Abilities[2] = (PlayerPrefs.GetInt("Slot" + Slot + "Art" + i));
                NewMember.Abilities[3] = (PlayerPrefs.GetInt("Slot" + Slot + "Sound" + i));
                NewMember.Loyalty      = PlayerPrefs.GetInt("Slot" + Slot + "Loyalty" + i);
                NewMember.MemberNumber = PlayerPrefs.GetInt("Slot" + Slot + "Number" + i);

                NewMember.Violence = PlayerPrefs.GetInt("Slot" + Slot + "Violence" + i);
                NewMember.Emotion  = PlayerPrefs.GetInt("Slot" + Slot + "Emotion" + i);
                NewMember.Strategy = PlayerPrefs.GetInt("Slot" + Slot + "Strategy" + i);
                NewMember.Control  = PlayerPrefs.GetInt("Slot" + Slot + "Control" + i);
                NewMember.Liberty  = PlayerPrefs.GetInt("Slot" + Slot + "Liberty" + i);
                NewMember.Puzzle   = PlayerPrefs.GetInt("Slot" + Slot + "Puzzle" + i);
                NewMember.Simplity = PlayerPrefs.GetInt("Slot" + Slot + "Simplity" + i);
                NewMember.Story    = PlayerPrefs.GetInt("Slot" + Slot + "Story" + i);

                if (PlayerPrefs.GetInt("Slot" + Slot + "Controllabel" + i) == 1)
                {
                    NewMember.Controllable = true;
                }
                else
                {
                    NewMember.Controllable = false;
                }
                NewMember.UnControllableDuration = PlayerPrefs.GetInt("Slot" + Slot + "UnControllableDuration" + i);
                if (PlayerPrefs.GetInt("Slot" + Slot + "DoubleBuff" + i) == 1)
                {
                    NewMember.DoubleBuff = true;
                }
                else
                {
                    NewMember.DoubleBuff = false;
                }
                NewMember.UnControllableDuration = PlayerPrefs.GetInt("Slot" + Slot + "UnControllableDuration" + i);

                SetPrevActs(Slot, NewMember, i);

                for (int j = 0; j < PlayerPrefs.GetInt("Slot" + Slot + "Members"); j++)
                {
                    NewMember.Relationship.Add(PlayerPrefs.GetInt("Slot" + Slot + "RelationShip" + i + "." + j));
                }

                if (PlayerPrefs.GetInt("Slot" + Slot + "Gender" + i) == 1)
                {
                    NewMember.Gender = true;
                    Var.MaleMems.Add(NewMember);
                }
                else
                {
                    NewMember.Gender = false;
                    Var.FemaleMems.Add(NewMember);
                }

                if (PlayerPrefs.GetInt("Slot" + Slot + "Special" + i) == 1)
                {
                    NewMember.SetSpecMemEtc();
                    NewMember.Special = true;
                }
                else
                {
                    if (PlayerPrefs.GetInt("Slot" + Slot + "Gender" + i) == 1)
                    {
                        NewMember.Renderer.sprite       = NewMember.MaleBase;
                        NewMember.HairRenderer.sprite   = NewMember.MaleHairs[PlayerPrefs.GetInt("Slot" + Slot + "HairStyle" + i)];
                        NewMember.ShirtsRenderer.sprite = NewMember.MaleShirts;
                        NewMember.PantsRenderer.sprite  = NewMember.MalePants;
                    }
                    else
                    {
                        NewMember.Renderer.sprite       = NewMember.FemaleBase;
                        NewMember.HairRenderer.sprite   = NewMember.FemaleHairs[PlayerPrefs.GetInt("Slot" + Slot + "HairStyle" + i)];
                        NewMember.ShirtsRenderer.sprite = NewMember.FemaleShirts;
                        NewMember.PantsRenderer.sprite  = NewMember.FemalePants;
                    }

                    NewMember.HairR   = PlayerPrefs.GetFloat("Slot" + Slot + "HairR" + i);
                    NewMember.HairG   = PlayerPrefs.GetFloat("Slot" + Slot + "HairG" + i);
                    NewMember.HairB   = PlayerPrefs.GetFloat("Slot" + Slot + "HairB" + i);
                    NewMember.ShirtsR = PlayerPrefs.GetFloat("Slot" + Slot + "ShirtsR" + i);
                    NewMember.ShirtsG = PlayerPrefs.GetFloat("Slot" + Slot + "ShirtsG" + i);
                    NewMember.ShirtsB = PlayerPrefs.GetFloat("Slot" + Slot + "ShirtsB" + i);
                    NewMember.PantsR  = PlayerPrefs.GetFloat("Slot" + Slot + "PantsR" + i);
                    NewMember.PantsG  = PlayerPrefs.GetFloat("Slot" + Slot + "PantsG" + i);
                    NewMember.PantsB  = PlayerPrefs.GetFloat("Slot" + Slot + "PantsB" + i);

                    NewMember.SendMessage("SetRendererColors");
                }

                Var.Mems.Add(NewMember);
            }
        }
    }
Esempio n. 24
0
 // Use this for initialization
 void Awake()
 {
     active = this;
 }
Esempio n. 25
0
 void Awake()
 {
     tutorial = GameObject.FindObjectOfType <TutorialText>();
 }
Esempio n. 26
0
 IEnumerator ShowWaitTap(TutorialText tText, string s1, string s2)
 {
     yield return StartCoroutine(tText.Show (s1, s2));
     yield return StartCoroutine (WaitForTap ());
     yield return StartCoroutine(tText.Hide ());
 }
Esempio n. 27
0
 // Use this for initialization
 void Awake()
 {
     s  = this;
     tx = GetComponent <Text> ();
     Pause(false);
 }
    // Update is called once per frame
    void Update()
    {
        if (gm.startingMenu)
        {
            for (int i = 0; i < tutorialText.Length; i++)
            {
                TutorialText tt = tutorialText[i];
                switch (tt.name)
                {
                case "Minimap":
                    if (gm.playerManager.playerLevelSelect.SelectedConstellationName == "NOTHING")
                    {
                        tt.SetText(0);
                    }
                    else
                    {
                        tt.SetText(1);
                    }
                    break;

                default:
                    tt.SetText(0);
                    break;
                }
            }
        }
        else if (gm.inPlay)
        {
            for (int i = 0; i < tutorialText.Length; i++)
            {
                TutorialText tt = tutorialText[i];
                switch (tt.name)
                {
                case "Interact":
                    if (gm.playerManager.playerDrawLine.selectedStar == null)
                    {
                        tt.SetText(1);
                    }
                    else
                    {
                        tt.SetText(2);
                    }
                    break;

                case "Minimap":
                    tt.SetText(2);
                    break;

                case "Clues":
                    if (!gm.playerManager.playerViewHints.viewingHints)
                    {
                        tt.SetText(1);
                    }
                    else
                    {
                        tt.SetText(2);
                    }
                    break;

                case "Next":
                case "Prev":
                    tt.SetText(1);
                    break;

                default:
                    tt.SetText(0);
                    break;
                }
            }
        }
    }
Esempio n. 29
0
    IEnumerator Tutorial()
    {
        TutorialText tText = GameObject.Find("TutorialText").GetComponentInChildren <TutorialText> ();

        gridPlaces[60].hexaCube.SlowSpawn(Constants.ChooseColor(2));
        gridPlaces[59].hexaCube.SlowSpawn(Constants.ChooseColor(2));
        gridPlaces[58].hexaCube.SlowSpawn(Constants.ChooseColor(0));
        gridPlaces[57].hexaCube.SlowSpawn(Constants.ChooseColor(2));
        gridPlaces[56].hexaCube.SlowSpawn(Constants.ChooseColor(0));
        gridPlaces[55].hexaCube.SlowSpawn(Constants.ChooseColor(0));
        gridPlaces[54].hexaCube.SlowSpawn(Constants.ChooseColor(0));

        colorSelector.Init(0, 3);
        colorSelector.DisableSwap();

        startScore  = 0;
        targetScore = 4000;

        bool passed    = false;
        int  failcount = 0;

        canFlood   = true;
        canDestroy = false;

        yield return(StartCoroutine(ShowWaitTap(tText, "welcome to hexciter", "(tap to continue)")));

        while (!passed)
        {
            flooded   = false;
            destroyed = false;

            yield return(StartCoroutine(tText.Show("press and hold the center hex", "")));

            yield return(StartCoroutine(WaitForCenterSelect()));

            yield return(StartCoroutine(tText.Hide()));

            colorSelector.GetComponentInChildren <TutorialArrow> ().FadeIn();
            yield return(StartCoroutine(tText.Show("swipe left to flood", "this uses the color shown here")));

            yield return(StartCoroutine(WaitForMoveCenter()));

            colorSelector.GetComponentInChildren <TutorialArrow> ().FadeOut();
            disabled = true;

            //Check if they're purposefully failing
            if (failcount > 4)
            {
                break;
            }

            if (!flooded)
            {
                //did the wrong move
                if (destroyed)
                {
                    failcount++;
                }

                yield return(StartCoroutine(tText.Hide()));

                continue;
            }

            //Player flooded
            passed = true;
        }
        if (!passed)
        {
            StartCoroutine(FailInstructions());
            yield break;
        }
        yield return(StartCoroutine(tText.Hide()));

        yield return(StartCoroutine(ShowWaitTap(tText, "well done!", "the hexes changed color")));

        colorSelector.GetComponentInChildren <TutorialArrow> ().FadeIn();
        yield return(StartCoroutine(ShowWaitTap(tText, "you'll always flood using this color", "(tap to continue)")));

        yield return(StartCoroutine(tText.Show("tap the palette to swap colors", "")));

        colorSelector.EnableSwap();
        yield return(StartCoroutine(WaitForSwap()));

        colorSelector.DisableSwap();
        yield return(StartCoroutine(tText.Hide()));

        colorSelector.GetComponentInChildren <TutorialArrow> ().FadeOut();

        passed     = false;
        canFlood   = false;
        canDestroy = true;

        while (!passed)
        {
            flooded   = false;
            destroyed = false;

            yield return(StartCoroutine(tText.Show("press and hold the center hex", "")));

            yield return(StartCoroutine(WaitForCenterSelect()));

            yield return(StartCoroutine(tText.Hide()));

            yield return(StartCoroutine(tText.Show("swipe right to destroy!", "")));

            yield return(StartCoroutine(WaitForMoveCenter()));

            disabled = true;

            //Check if they're purposefully failing
            if (failcount > 4)
            {
                break;
            }

            if (!destroyed)
            {
                //did the wrong move
                if (flooded)
                {
                    failcount++;
                }

                yield return(StartCoroutine(tText.Hide()));

                continue;
            }

            //Player destroyed
            passed = true;
        }
        if (!passed)
        {
            StartCoroutine(FailInstructions());
            yield break;
        }

        yield return(StartCoroutine(tText.Hide()));

        yield return(StartCoroutine(ShowWaitTap(tText, "destroying hexes earns points", "match the color palette to earn bonus points!")));

        GameObject.Find("GUICamera/MiddleRight").GetComponentInChildren <TutorialArrow> ().FadeIn();
        yield return(StartCoroutine(ShowWaitTap(tText, "as you earn points, this bar fills", "(tap to continue)")));

        GameObject.Find("GUICamera/MiddleRight").GetComponentInChildren <TutorialArrow> ().FadeOut();
        GameObject.Find("GUICamera/MoveProgress/tutorialArrow1").GetComponent <TutorialArrow> ().FadeIn();
        yield return(StartCoroutine(ShowWaitTap(tText, "each turn uses a grey hex", "(tap to continue)")));

        yield return(StartCoroutine(ShowWaitTap(tText, "fill the bar before you use them all!", "(tap to continue)")));

        GameObject.Find("GUICamera/MoveProgress/tutorialArrow1").GetComponent <TutorialArrow> ().FadeOut();

        for (int i = 0; i < 54; i++)
        {
            gridPlaces[i].hexaCube.SlowSpawn(Constants.RandomColor());
        }

        for (int i = 0; i < 6; i++)
        {
            moves.DoMove();
        }

        //GameObject.Find ("GUICamera/MoveProgress/tutorialArrow2").GetComponent<TutorialArrow> ().FadeIn ();

        yield return(StartCoroutine(tText.Show("try making a move yourself", "you have one turn left")));

        disabled  = false;
        flooded   = false;
        destroyed = false;
        colorSelector.EnableSwap();
        targetScore = 8000;
        yield return(StartCoroutine(WaitForMove()));

        //GameObject.Find ("GUICamera/MoveProgress/tutorialArrow2").GetComponent<TutorialArrow> ().FadeOut ();
        while (GridBusy())
        {
            yield return(new WaitForSeconds(0.1f));
        }
        StartCoroutine(NextLevel());
        while (GridBusy())
        {
            yield return(new WaitForSeconds(0.1f));
        }
        yield return(StartCoroutine(tText.Hide()));

        disabled = true;
        colorSelector.DisableSwap();

        yield return(StartCoroutine(ShowWaitTap(tText, "you ran out of turns", "before the score bar was filled")));

        yield return(StartCoroutine(ShowWaitTap(tText, "when the board is empty...", "it's gameover!")));

        yield return(StartCoroutine(ShowWaitTap(tText, "now you're ready to play!", "(tap to start the game)")));

        SocialManager.Instance.UnlockAchievement("hello world");

        FadeCam.Instance.FadeOut(() => { Application.LoadLevel("game"); });
    }
Esempio n. 30
0
 public void OnPointerEnter()
 {
     TutorialText.ChangeText("Click an Item to drop it");
     InfoUpdater.EnterAction(item);
 }
Esempio n. 31
0
 public void OnPointerExit()
 {
     TutorialText.ChangeText("");
     InfoUpdater.EnterAction(null);
 }
Esempio n. 32
0
        void ReleaseDesignerOutlets()
        {
            if (BottomConstraint != null)
            {
                BottomConstraint.Dispose();
                BottomConstraint = null;
            }

            if (HelpCenterBack != null)
            {
                HelpCenterBack.Dispose();
                HelpCenterBack = null;
            }

            if (HelpCenterFormCaption != null)
            {
                HelpCenterFormCaption.Dispose();
                HelpCenterFormCaption = null;
            }

            if (HelpCenterHeaderText != null)
            {
                HelpCenterHeaderText.Dispose();
                HelpCenterHeaderText = null;
            }

            if (LoaderCircle != null)
            {
                LoaderCircle.Dispose();
                LoaderCircle = null;
            }

            if (MessageContainer != null)
            {
                MessageContainer.Dispose();
                MessageContainer = null;
            }

            if (MessageEdit != null)
            {
                MessageEdit.Dispose();
                MessageEdit = null;
            }

            if (MessageSend != null)
            {
                MessageSend.Dispose();
                MessageSend = null;
            }

            if (OpenTutorial != null)
            {
                OpenTutorial.Dispose();
                OpenTutorial = null;
            }

            if (QuestionsScroll != null)
            {
                QuestionsScroll.Dispose();
                QuestionsScroll = null;
            }

            if (RippleHelpCenter != null)
            {
                RippleHelpCenter.Dispose();
                RippleHelpCenter = null;
            }

            if (RippleTutorial1 != null)
            {
                RippleTutorial1.Dispose();
                RippleTutorial1 = null;
            }

            if (RippleTutorial2 != null)
            {
                RippleTutorial2.Dispose();
                RippleTutorial2 = null;
            }

            if (RoundBottom != null)
            {
                RoundBottom.Dispose();
                RoundBottom = null;
            }

            if (RoundBottomTutorial != null)
            {
                RoundBottomTutorial.Dispose();
                RoundBottomTutorial = null;
            }

            if (Snackbar != null)
            {
                Snackbar.Dispose();
                Snackbar = null;
            }

            if (SnackBottomConstraint != null)
            {
                SnackBottomConstraint.Dispose();
                SnackBottomConstraint = null;
            }

            if (SnackTopConstraint != null)
            {
                SnackTopConstraint.Dispose();
                SnackTopConstraint = null;
            }

            if (TutorialBack != null)
            {
                TutorialBack.Dispose();
                TutorialBack = null;
            }

            if (TutorialBottomSeparator != null)
            {
                TutorialBottomSeparator.Dispose();
                TutorialBottomSeparator = null;
            }

            if (TutorialFrame != null)
            {
                TutorialFrame.Dispose();
                TutorialFrame = null;
            }

            if (TutorialFrameBg != null)
            {
                TutorialFrameBg.Dispose();
                TutorialFrameBg = null;
            }

            if (TutorialLoadNext != null)
            {
                TutorialLoadNext.Dispose();
                TutorialLoadNext = null;
            }

            if (TutorialLoadPrevious != null)
            {
                TutorialLoadPrevious.Dispose();
                TutorialLoadPrevious = null;
            }

            if (TutorialNavBar != null)
            {
                TutorialNavBar.Dispose();
                TutorialNavBar = null;
            }

            if (TutorialNavText != null)
            {
                TutorialNavText.Dispose();
                TutorialNavText = null;
            }

            if (TutorialText != null)
            {
                TutorialText.Dispose();
                TutorialText = null;
            }

            if (TutorialTopBar != null)
            {
                TutorialTopBar.Dispose();
                TutorialTopBar = null;
            }

            if (TutorialTopSeparator != null)
            {
                TutorialTopSeparator.Dispose();
                TutorialTopSeparator = null;
            }
        }
Esempio n. 33
0
 void Awake()
 {
     if (instance == null)
         instance = this;
 }