分享

Switch Statements

 三维记忆 2019-11-19

ConversationScript

using UnityEngine; using System.Collections;

public class ConversationScript : MonoBehaviour

{ public int intelligence = 5; void Greet() { switch (intelligence) {

case 5:

            print ("Why hello there good sir! Let me teach you about Trigonometry!");

            break;

        case 4:

            print ("Hello and good day!");

            break;

        case 3:

            print ("Whadya want?");

            break;

        case 2:

            print ("Grog SMASH!");

            break;

        case 1:

            print ("Ulg, glib, Pblblblblb");

            break;

        default:

            print ("Incorrect intelligence level.");

     break; } } }

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多