当前位置: 首页>>代码示例>>C#>>正文


C# Student.levelUP方法代码示例

本文整理汇总了C#中Student.levelUP方法的典型用法代码示例。如果您正苦于以下问题:C# Student.levelUP方法的具体用法?C# Student.levelUP怎么用?C# Student.levelUP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Student的用法示例。


在下文中一共展示了Student.levelUP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PickStudent

    /* wait until talking with Student 3 */
    IEnumerator PickStudent()
    {
        yield return new WaitForSeconds(2.5f);
        while (true)
        {
            /* When talking with student3, make special effect */
            if (GameObject.Find("학생3").GetComponent<Dialogue>().getDialogueOnOff() == true)
            {
                int i;
                GetComponent<AudioSource>().PlayOneShot(ShockSound);
                maincam.GetComponent<Camera>().orthographicSize = 3;

                do {
                i = Random.Range(1, 101);
                } while (i % 10 != 0 && i % 10 != 1);

                Student stu = new Student((stu_no)i);
                GameManager.pl_stored.GetComponent<CharacterStatus>().setStudent(stu);
                stu.levelUP();
                stu.levelUP();
                warp.SetActive(true);
                break;
            }
            yield return new WaitForSeconds(3.5f);
        }

        /* Call Dialogue of Additional picking conversation */
        while (true)
        {
            if (GameObject.Find("학생3").GetComponent<Dialogue>().getDialogueOnOff() == false)
            {
                GameObject.Find("StoryDirector").GetComponent<NPCStatus>().interaction(GameManager.pl_stored);
                break;
            }
            yield return new WaitForSeconds(0.5f);
        }

        /* Zoom Out when dialogue fininshed */
        while (true)
        {
            if (GameObject.Find("StoryDirector").GetComponent<Dialogue>().getDialogueOnOff() == false)
            {
                maincam.GetComponent<Camera>().orthographicSize = 7;
                break;
            }
            yield return new WaitForSeconds(0.5f);
        }

        float fade = maincam.GetComponent<Fading>().BeginFade(1);
        yield return new WaitForSeconds(fade);
        GameManager.ChangeMap(1);
    }
开发者ID:POSTECH-OOP-14,项目名称:POSMON,代码行数:53,代码来源:StoryEffector.cs

示例2: OnTriggerStay2D

    void OnTriggerStay2D(Collider2D other)
    {
        if (other.gameObject.tag == "Player" && inProgress == false)
        {
            Debug.Log("field collision occured");
            float level_sum = 0;

            /* Randomly Emgerge Student */
            if (Random.Range(1, 1000000) < probability_million)
            {
                bool playerValidity = false;
                int type;
                Student wild_student;

                /* setting player battle info */
                GameManager.resetBattleStudents();
                for (int i = 0; i < 6; i++)
                    GameManager.setBattlePlayerStudent(i, GameManager.pl_stored.GetComponent<CharacterStatus>().getStudent(i));

                /* check validity */
                for (int i = 0; i < 6; i++)
                {
                    Student player_stu = GameManager.pl_stored.GetComponent<CharacterStatus>().getStudent(i);
                    if (player_stu != null && player_stu.getHP() >= 1)
                        playerValidity = true;
                }

                /* setting wild student and application level */
                if (playerValidity)
                {
                    for (int i = 0; i < 6; i++)
                    {
                        Student stu = GameManager.pl_stored.GetComponent<CharacterStatus>().getStudent(i);
                        if (stu != null)
                            level_sum += stu.getLevel();
                    }

                    do
                    {
                        type = Random.Range(1, 101);
                    } while (type % 10 != 0 && type % 10 != 1);

                    /* setting wild student */
                    wild_student = new Student((stu_no)type);
                    float target_level = (level_sum / GameManager.pl_stored.GetComponent<CharacterStatus>().getStudentCount());
                    for (int i = 0; i < leveling_limit; i++)
                    {
                        if (Random.value < leveling_probability)
                            target_level += 1;
                    }
                    target_level *= level_multiplier;

                    for (int i = 0; i < target_level; i++)
                        wild_student.levelUP();

                    GameManager.setBattleTrainerStudent(0, wild_student);
                    GameManager.setBattleHostNum(0);

                    StartCoroutine(LoadLevel());
                }
            }
        }
    }
开发者ID:POSTECH-OOP-14,项目名称:POSMON,代码行数:63,代码来源:RandomStudentField.cs


注:本文中的Student.levelUP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。