Beispiel #1
0
        public void SetOnCooldown()
        {
            startCounting = true;

            cdCounter.gameObject.SetActive(true);
            cdCounter.StartTimer(0, (int)currentSkill.cooldown, EnableSkill);
        }
Beispiel #2
0
 private void Reset()
 {
     level.Load();
     Inventory.instance.Reset();
     player.SetActive(false);
     portal.Appear();
     timer.gameObject.SetActive(level.data.timer > 0);
     timer.SetTime(level.data.timer);
     message.SetMessage(level.data.message);
     aq.Delay(0.9f);
     aq.Add(() =>
     {
         if (level.data.specialStart)
         {
             player.transform.position = new Vector3(-3, -3.74626f, 0);
         }
         else
         {
             player.transform.position = portal.transform.position;
         }
         player.SetActive(true);
         playerPS.Play();
         if (timer.gameObject.activeSelf)
         {
             timer.StartTimer();
         }
     });
     aq.Run();
 }
 public void CheckReadiness()
 {
     if (attackerReportPanel.isReady && defenderReportPanel.isReady)
     {
         nextDayTimer.gameObject.SetActive(true);
         nextDayCover.gameObject.SetActive(true);
         nextDayTimer.StartTimer(0, 5, StartNextDay);
     }
     else
     {
         nextDayTimer.startTimer = false;
         nextDayTimer.gameObject.SetActive(false);
         nextDayCover.gameObject.SetActive(false);
     }
 }
Beispiel #4
0
    public void SetupHeroSpawn(int newUnitCooldown)
    {
        maxCounter = newUnitCooldown;

        cdCounter.gameObject.SetActive(true);
        cdCounter.StartTimer(0, maxCounter, AllowHeroSpawn);
        switch (myController.controlType)
        {
        case PlayerControlType.PlayerOne:
            heroSummonText.text = "R";
            break;

        case PlayerControlType.PlayerTwo:
            heroSummonText.text = "6";
            break;

        case PlayerControlType.Computer:
            heroSummonText.text = "-";
            break;

        default:
            break;
        }
    }
Beispiel #5
0
    public void ToggleRecording()
    {
                #if SHOULD_USE_RECORDING_PLUGIN
        if (isBusy)
        {
            return;
        }

        CancelInvoke("ResetBusyStatus");
        CancelInvoke("ToggleRecording");

        if (!isRecording)
        {
                        #if UNITY_IOS && !UNITY_EDITOR
            if (MergeIOSBridge.CheckPhoto() == 2)
            {
                MergeIOSBridge.RequestPhoto();
                return;
            }
            else if (MergeIOSBridge.CheckPhoto() != 1)
            {
                MergeIOSBridge.OpenPhotoSettings();
                return;
            }
                        #endif
                        #if UNITY_ANDROID && !UNITY_EDITOR
            if (!MergeAndroidBridge.HasPermission(AndroidPermission.WRITE_EXTERNAL_STORAGE))
            {
                MergeAndroidBridge.CheckPermissionAndReDirectToSettingsScreen(AndroidPermission.READ_EXTERNAL_STORAGE);
                return;
            }
            if (!MergeAndroidBridge.HasPermission(AndroidPermission.RECORD_AUDIO))
            {
                MergeAndroidBridge.CheckPermissionAndReDirectToSettingsScreen(AndroidPermission.RECORD_AUDIO);
                return;
            }
                        #endif

            StartRec(System.DateTime.Now.Day.ToString() + "_" + System.DateTime.Now.Month.ToString() + "_" +
                     System.DateTime.Now.Year.ToString() + "_" + System.DateTime.Now.Hour.ToString() + "_" + System.DateTime.Now.Minute.ToString(), null);

//			RecordingButton.gameObject.SetActive( false );
            timer.StartTimer();
            isBusy = true;

            Invoke("ResetBusyStatus", 3f);

            //Stop recording after 30 seconds if still running.
            Invoke("ToggleRecording", 30f);
        }
        else
        {
//			Debug.LogWarning("Should Stop Recording.");

//			RecordingButton.gameObject.SetActive( true );
            timer.StopTimer();
            isBusy = true;
            StopRec();

//			Debug.LogWarning("Should Set Recording to False.");
        }
                #endif
    }
Beispiel #6
0
 // Starts the Mission Timer
 public void StartMissionTimer()
 {
     missionTimer.gameObject.SetActive(true);
     missionTimer.StartTimer(true);
 }