コード例 #1
0
    //
    public void SubscribeMethod(string AchieveType, int Id)
    {
        switch (AchieveType)
        {
        case "Jump":

            if (playData.achievements[Id].State == false)
            {
                JumpEvent += new JumpDelegate(JumpMethod);
                JumpBool   = true;
                JumpId     = Id;
                JumpTarget = playData.achievements[Id].Target;
            }
            break;

        case "Level":
            if (playData.achievements[Id].State == false)
            {
                LevelEvent += new LevelDelegate(LevelMethod);
                LevelBool   = true;
                LevelId     = Id;
                playData.achievements[LevelId].Done = playData.level;
                LevelTarget = playData.achievements[Id].Target;
            }
            break;

        case "Attack":
            if (playData.achievements[Id].State == false)
            {
                AttackEvent += new AttackDelegate(AttackMethod);
                AttackBool   = true;
                AttackId     = Id;
                AttackTarget = playData.achievements[Id].Target;
            }
            break;

        case "Die":
            if (playData.achievements[Id].State == false)
            {
                DieEvent += new DieDelegate(DieMethod);
                DieBool   = true;
                DieId     = Id;
                DieTarget = playData.achievements[Id].Target;
            }
            break;

        case "Kill":
            if (playData.achievements[Id].State == false)
            {
                KillEvent += new KillDelegate(KillMethod);
                KillBool   = true;
                KillId     = Id;
                KillTarget = playData.achievements[Id].Target;
            }
            break;
        }
    }
コード例 #2
0
ファイル: MapTransitioner.cs プロジェクト: kellpossible/GPMS
    // Use this for initialization
    void Start()
    {
        // get references to required classes
        GameObject gameCtrl = GameObject.Find("Game Ctrl");

        gameCtrlScript = (GameController)gameCtrl.GetComponent(typeof(GameController));

        findAndHideTemplateMapTiles();


        LevelAvailable += delegate {
            if (Verbose >= 1)
            {
                Debug.Log("Level Available");
            }
        };
    }