Example #1
0
 public void SetLabel(string label, string description)
 {
     Label.text = label;
     if (Label.GetComponent <TooltipContent>().tooltipRect == null)
     {
         Label.GetComponent <TooltipContent>().tooltipRect = Base.GameManager.Instance.Tooltip;
     }
     if (Label.GetComponent <TooltipContent>().descriptionText == null)
     {
         Label.GetComponent <TooltipContent>().descriptionText = Base.GameManager.Instance.Text;
     }
     Label.GetComponent <TooltipContent>().description = description;
 }
Example #2
0
 public void check()
 {
     if (name.text == "")
     {
         tobedisabled.SetActive(false);
         tobeenabled1.SetActive(true);
     }
     else
     {
         PlayerPrefs.SetString("PlayerName", name.GetComponent <TMPro.TMP_Text>().text);
         PhotonNetwork.LocalPlayer.NickName = name.GetComponent <TMPro.TMP_Text>().text;
         setMessage.text = PlayerPrefs.GetString("PlayerName") + " , choose a option";
         tobedisabled.SetActive(false);
         tobeenabled2.SetActive(true);
     }
 }
Example #3
0
 public override void OnJoinedRoom()
 {
     Debug.Log("joined the room");
     status.text = "joined the room";
     PhotonNetwork.LocalPlayer.NickName = playername.GetComponent <TMPro.TMP_Text>().text;
     tobedisabled0.SetActive(false);
     tobeenabled01.SetActive(true);
 }
Example #4
0
 private void Awake()
 {
     Debug.Assert(Label != null);
     Debug.Assert(Input != null);
     tooltipContent = Label.GetComponent <TooltipContent>();
     if (!string.IsNullOrEmpty(ParameterType))
     {
         SetType(ParameterType);
     }
     SetLabel(Label.text, null);
 }
Example #5
0
 private void Awake()
 {
     Debug.Assert(label != null);
     Debug.Assert(posX != null);
     Debug.Assert(posY != null);
     Debug.Assert(posZ != null);
     Debug.Assert(orX != null);
     Debug.Assert(orY != null);
     Debug.Assert(orZ != null);
     Debug.Assert(orW != null);
     tooltipContent                 = label.GetComponent <TooltipContent>();
     tooltipContent.tooltipRect     = Base.GameManager.Instance.Tooltip;
     tooltipContent.descriptionText = Base.GameManager.Instance.Text;
 }
    IEnumerator C_Run()
    {
        RectTransform rectR = m_ReadyText.GetComponent <RectTransform>();

        while (true)
        {
            float   deltatime = Time.deltaTime;
            Vector3 pos       = rectR.localPosition;
            if (pos.x < 0.0f)
            {
                float minspeed = deltatime * m_TextSpeed;
                pos.x += Mathf.Clamp(Mathf.Abs(pos.x) * (deltatime * m_TextSpeed), minspeed, 999999.0f);
                rectR.localPosition = pos;
                if (pos.x >= 0.0f)
                {
                    break;
                }
            }
            yield return(null);
        }

        yield return(new WaitForSeconds(0.5f));

        RectTransform rectS      = m_StartText.GetComponent <RectTransform>();
        float         startspeed = Mathf.Abs(rectR.position.x);

        while (true)
        {
            float   deltatime = Time.deltaTime;
            Vector3 pos       = rectS.localPosition;
            Vector3 posR      = rectR.localPosition;
            if (pos.x < 0.0f)
            {
                float minspeed = deltatime * m_TextSpeed;
                float addX     = Mathf.Clamp(Mathf.Abs(pos.x) * (deltatime * m_TextSpeed), minspeed, 999999.0f);
                pos.x  += addX;
                posR.x += addX;
                rectS.localPosition = pos;
                rectR.localPosition = posR;
                if (pos.x >= 0.0f)
                {
                    break;
                }
            }
            yield return(null);
        }

        yield return(new WaitForSeconds(0.5f));

        IsComplete = true;

        float timer = 1.0f;

        while (timer > 0.0f)
        {
            float deltatime = Time.deltaTime;
            timer += deltatime;
            Vector3 pos = rectS.localPosition;
            pos.x += deltatime * m_TextSpeed * startspeed;
            rectS.localPosition = pos;
            yield return(null);
        }
    }
    private IEnumerator TutorialScene()
    {
        // Get data from GameManager
        Pawn          pawn  = gm.selectedPawn;
        SoundManager  sound = SoundManager.instance;
        CameraControl cam   = CameraControl.instance;

        // Initialize components
        map.chosenMap = mapType;
        map.GenerateMap();
        player.Init(pawn);
        knight             = (KnightHero)player.hero;
        enemyManager.level = 1;

        SoundManager.instance.PlayMusicLoop(map.data.musicLoop, map.data.musicIntro);

        gm.OnSceneLoaded -= Init;           // Remove the listener because it is only run once per scene


        // Step -2: Swipe
        DisableTap();
        DisableSpecialAbility();
        tutorialTaskView.Init("Swipe to use your Rush Ability", false);

        knight.OnKnightRush += IncrementRushCount;
        while (knightRushCount < 1)
        {
            yield return(null);
        }
        tutorialTaskView.SetCompleted(true);
        sound.PlayUISound(taskCompleteSound);
        yield return(new WaitForSeconds(TASK_DELAY_INTERVAL));

        knightRushCount = 0;

        // Step -1: Learn swipe controls
        tutorialTaskView.SetCompleted(false);
        while (knightRushCount < 3)
        {
            tutorialTaskView.SetText(string.Format("Use your Rush Ability 3 times ({0}/3)", knightRushCount));
            yield return(null);
        }
        tutorialTaskView.Init("Use your Rush Ability 3 times (3/3)", true);
        sound.PlayUISound(taskCompleteSound);
        yield return(new WaitForSeconds(TASK_DELAY_INTERVAL));

        knightRushCount = 0;
        abilitiesBar.abilityIcons[0].StopFlashHighlight();
        knight.OnKnightRush -= IncrementRushCount;

        // Step 0: Learn tap controls
        tutorialTaskView.SetCompleted(false);
        PlayKnightCharDialogue(0);
        yield return(new WaitUntil(() => !dialogueView.dialoguePlaying));

        cam.ResetFocus();

        tutorialTaskView.Init("Use your Shield Ability 2 times (0/2)", false);
        //controlPointer.gameObject.SetActive(true);
        //controlPointer.CrossFade("Tap", 0f);
        //abilitiesBar.abilityIcons[1].FlashHighlight(Color.white);
        EnableTap();

        knight.OnKnightShield += IncrementShieldCount;

        // Tip about cooldown timers
        while (knightShieldCount < 1)
        {
            yield return(null);
        }
        yield return(new WaitForSecondsRealtime(1.0f));

        highlighter.Highlight(abilitiesBar.abilityIcons[1].image.rectTransform.position,
                              abilitiesBar.abilityIcons[1].image.rectTransform.sizeDelta);
        tipText.text = "Keep an eye on your cooldown timers. You can't use an ability while it is cooling down!";
        while (highlighter.gameObject.activeInHierarchy)
        {
            yield return(null);
        }

        while (knightShieldCount < 2)
        {
            tutorialTaskView.SetText(string.Format("Use your Shield Ability 2 times ({0}/2)", knightShieldCount));
            yield return(null);
        }
        tutorialTaskView.Init("Use your Shield Ability 2 times (2/2)", true);
        sound.PlayUISound(taskCompleteSound);
        yield return(new WaitForSeconds(TASK_DELAY_INTERVAL));

        abilitiesBar.abilityIcons[1].StopFlashHighlight();
        //controlPointer.gameObject.SetActive(false);
        knightShieldCount      = 0;
        knight.OnKnightShield -= IncrementShieldCount;

        // Step 1: Attacking a dummy
        PlayKnightCharDialogue(1);
        yield return(new WaitUntil(() => !dialogueView.dialoguePlaying));

        cam.ResetFocus();

        tutorialTaskView.Init("Destroy the dummy", false);
        GameObject trainingDummy      = enemyManager.SpawnEnemy(trainingDummyPrefab, map.CenterPosition);
        Enemy      trainingDummyEnemy = trainingDummy.GetComponentInChildren <Enemy>();

        trainingDummyEnemy.OnEnemyDamaged += SetOuchText;
        ouchText.GetComponent <UIFollow>().Init(trainingDummy.transform, trainingDummyEnemy.healthBarOffset * 1.5f);
        while (trainingDummy.gameObject.activeInHierarchy)
        {
            yield return(null);
        }
        tutorialTaskView.SetCompleted(true);
        sound.PlayUISound(taskCompleteSound);
        yield return(new WaitForSeconds(TASK_DELAY_INTERVAL));

        // Step 2: Learn the parry
        PlayKnightCharDialogue(2);
        yield return(new WaitUntil(() => !dialogueView.dialoguePlaying));

        cam.ResetFocus();

        //tutorialTaskView.Init("Parry 5 times (0/5)", false);
        Enemy attackingDummy = enemyManager.SpawnEnemy(attackingDummyPrefab, map.CenterPosition + (Vector3.right * 2f)).GetComponentInChildren <Enemy>();

        attackingDummy.invincible = true;
        knight.onParry           += IncrementParryCount;
        tutorialTaskView.SetCompleted(false);
        while (parryCount < 5)
        {
            tutorialTaskView.SetText(string.Format("Parry 5 times ({0}/5)", parryCount));
            yield return(null);
        }
        tutorialTaskView.Init("Parry 5 times (5/5)", true);
        sound.PlayUISound(taskCompleteSound);
        yield return(new WaitForSeconds(TASK_DELAY_INTERVAL));

        attackingDummy.invincible = false;
        attackingDummy.GetComponentInChildren <Enemy>().Damage(999);
        parryCount      = 0;
        knight.onParry -= IncrementParryCount;

        // Step 3: Finish tutorial
        PlayKnightCharDialogue(3);
        yield return(new WaitUntil(() => !dialogueView.dialoguePlaying));

        yield return(new WaitForSeconds(1.0f));

        GameManager.instance.GoToScene("Tutorial2");
    }
Example #8
0
 private void Awake()
 {
     tooltipContent = Label.GetComponent <TooltipContent>();
 }
Example #9
0
 private void Awake()
 {
     // apparently this can't be set in the inspector
     text.GetComponent <Renderer>().sortingLayerName = "Score Particles";
 }