コード例 #1
0
    public void CreateMedalBoolArrays()
    {
        GlobalVars.isMultiplayer = false;

        if (GlobalVars.numOfLoads == 0)
        {
            GlobalVars.isTutorial = true;
        }

        if (GlobalVars.isTutorial || GlobalVars.numOfLoads <= 1)
        {
            SceneManager.LoadScene("Tutorial");
            MedalHandler.InitArrays();
            GlobalVars.numOfLoads++;

            if (GlobalVars.numOfLoads > 1)
            {
                introText = "CNOTUINE";
                GetComponentInChildren <Text>().text = introText;
            }
        }
        else
        {
            SceneManager.LoadScene("mainMenu");
        }
        //SceneManager.LoadScene("tutorial");
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        bool requiedMetals = (MedalHandler.GetGoldMedals() >= goldMetalsToUnlock);

        this.GetComponent <Button>().interactable = requiedMetals; //if you have enough medals, be able to click, if not, no click for you
        closedPrompt.SetActive(!requiedMetals);                    //prompt apprears if you do not have enough
    }
コード例 #3
0
ファイル: QuestionHandler.cs プロジェクト: Naomi95/FishyFishy
    // Use this for initialization
    void Start()
    {
        questionNumber = 1;
        questionText   = gameObject.GetComponent <Text> ();
        setQuestionText();

        medalHandler = MedalHandler.Getinstance();
    }
コード例 #4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this);
     }
 }
コード例 #5
0
    //When something hits its 2D collider
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.tag.Equals("Player"))
        {
            //----------Special Cases only During Tutorial----------------
            if (IsSceneTutorial())
            {
                dButton = GameObject.FindGameObjectWithTag("ConvoUIButton").GetComponent <DialogueButton>();
                dButton.SwitchingState(); //turns on dialogue when levels is finished
            }

            if (GlobalVars.isTutorial) //if a level is completed before the game "crashes"
            {
                crashing = true;       //activate crashing prompt
            }
            //------------------This is normal-----------------
            else //Display the result values
            {
                _text.text = "Final Time Is: " + totalTime.ToString();
                _panel.gameObject.SetActive(true);
                _panel.transform.Find("BronzeText").GetComponent <Text>().text = BronzeTime.ToString() + ".00";
                _panel.transform.Find("SilverText").GetComponent <Text>().text = SilverTime.ToString() + ".00";
                _panel.transform.Find("GoldText").GetComponent <Text>().text   = GoldTime.ToString() + ".00";
            }

            endTime = true; //stop the timer

            int medalNum = 0;

            if (SceneManager.GetActiveScene().name != "Tutorial") //calcuates the level time into medals
            {
                medalNum = MedalHandler.CalcMedalType(BronzeTime, SilverTime, GoldTime, totalTime);
            }
            else //just show the medals if it is the tutorial
            {
                medalNum = 3;
            }

            switch (medalNum) //activates a medal based upon the number it gets
            {
            case 3:
                goldMedal.gameObject.SetActive(true);
                goto case 2;

            case 2:
                silverMedal.gameObject.SetActive(true);
                goto case 1;

            case 1:
                bronzeMedal.gameObject.SetActive(true);
                break;

            default:
                print(":(");
                break;
            }

            //stop time if the level isn't the tutorial. We need time to still be functioning in the tutorial for animations to play
            if (!IsSceneTutorial())
            {
                Time.timeScale = 0;
            }
        }
    }
コード例 #6
0
 void Start()
 {
     goldText.text   = MedalHandler.GetGoldMedals().ToString();
     silverText.text = MedalHandler.GetSilverMedals().ToString();
     bronzeText.text = MedalHandler.GetBronzeMedals().ToString();
 }
コード例 #7
0
ファイル: GameSocket.cs プロジェクト: v8lab/yxjxmk
 public GameSocket(ISerializer serializer) : base(serializer)
 {
     _achievementHandler       = new AchievementHandler(this);
     _activityHandler          = new ActivityHandler(this);
     _activityFavorHandler     = new ActivityFavorHandler(this);
     _amuletHandler            = new AmuletHandler(this);
     _arenaHandler             = new ArenaHandler(this);
     _attendanceHandler        = new AttendanceHandler(this);
     _bagHandler               = new BagHandler(this);
     _battleHandler            = new BattleHandler(this);
     _cardHandler              = new CardHandler(this);
     _consignmentLineHandler   = new ConsignmentLineHandler(this);
     _crossServerHandler       = new CrossServerHandler(this);
     _dailyActivityHandler     = new DailyActivityHandler(this);
     _demonTowerHandler        = new DemonTowerHandler(this);
     _equipHandler             = new EquipHandler(this);
     _exchangeHandler          = new ExchangeHandler(this);
     _fashionHandler           = new FashionHandler(this);
     _fightLevelHandler        = new FightLevelHandler(this);
     _fleeHandler              = new FleeHandler(this);
     _friendHandler            = new FriendHandler(this);
     _functionHandler          = new FunctionHandler(this);
     _functionOpenHandler      = new FunctionOpenHandler(this);
     _giftOnlineHandler        = new GiftOnlineHandler(this);
     _goddessHandler           = new GoddessHandler(this);
     _guildBlessHandler        = new GuildBlessHandler(this);
     _guildBossHandler         = new GuildBossHandler(this);
     _guildDepotHandler        = new GuildDepotHandler(this);
     _guildHandler             = new GuildHandler(this);
     _guildShopHandler         = new GuildShopHandler(this);
     _guildTechHandler         = new GuildTechHandler(this);
     _hookSetHandler           = new HookSetHandler(this);
     _interactHandler          = new InteractHandler(this);
     _intergalMallHandler      = new IntergalMallHandler(this);
     _itemHandler              = new ItemHandler(this);
     _leaderBoardHandler       = new LeaderBoardHandler(this);
     _limitTimeActivityHandler = new LimitTimeActivityHandler(this);
     _mailHandler              = new MailHandler(this);
     _mapHandler               = new MapHandler(this);
     _masteryHandler           = new MasteryHandler(this);
     _medalHandler             = new MedalHandler(this);
     _messageHandler           = new MessageHandler(this);
     _mountHandler             = new MountHandler(this);
     _npcHandler               = new NpcHandler(this);
     _offlineAwardHandler      = new OfflineAwardHandler(this);
     _onlineGiftHandler        = new OnlineGiftHandler(this);
     _payGiftHandler           = new PayGiftHandler(this);
     _petHandler               = new PetHandler(this);
     _petNewHandler            = new PetNewHandler(this);
     _playerHandler            = new PlayerHandler(this);
     _prepaidHandler           = new PrepaidHandler(this);
     _rankHandler              = new RankHandler(this);
     _resourceDungeonHandler   = new ResourceDungeonHandler(this);
     _resourceHandler          = new ResourceHandler(this);
     _rewardHandler            = new RewardHandler(this);
     _saleHandler              = new SaleHandler(this);
     _shopMallHandler          = new ShopMallHandler(this);
     _skillHandler             = new SkillHandler(this);
     _skillKeysHandler         = new SkillKeysHandler(this);
     _soloHandler              = new SoloHandler(this);
     _stealHandler             = new StealHandler(this);
     _sysSetHandler            = new SysSetHandler(this);
     _taskHandler              = new TaskHandler(this);
     _teamHandler              = new TeamHandler(this);
     _tradeHandler             = new TradeHandler(this);
     _treasureHandler          = new TreasureHandler(this);
     _upLevelHandler           = new UpLevelHandler(this);
     _vipHandler               = new VipHandler(this);
     _vitalityHandler          = new VitalityHandler(this);
     _wingHandler              = new WingHandler(this);
     _activityRevelryHandler   = new ActivityRevelryHandler(this);
     _auctionHandler           = new AuctionHandler(this);
     _chatHandler              = new ChatHandler(this);
     _daoYouHandler            = new DaoYouHandler(this);
     _entryHandler             = new EntryHandler(this);
     _roleHandler              = new RoleHandler(this);
     _farmHandler              = new FarmHandler(this);
     _five2FiveHandler         = new Five2FiveHandler(this);
     _guildManagerHandler      = new GuildManagerHandler(this);
     _xianYuanHandler          = new XianYuanHandler(this);
 }
コード例 #8
0
 void Start()
 {
     medalHandler = MedalHandler.Getinstance();
 }