// Use this for initialization
 void Start()
 {
     resume = transform.Find("Resume").GetComponent <Button> ();
     exit   = transform.Find("Exit").GetComponent <Button> ();
     p      = GameObject.Find("Pauser").GetComponent <PauseControl> ();
     resume.onClick.AddListener(onResume);
     exit.onClick.AddListener(onExit);
 }
Ejemplo n.º 2
0
    //kim

    void Start()
    {
        //kim
        gameControl = gameControlGameObject.GetComponent <PauseControl>();
        //kim
        energySteps = 6;
        EnergyBar0  = GetComponent <Image>();
        Energy      = maxEnergy + 4000f;
        TotalEnergy = 1f;
    }
Ejemplo n.º 3
0
 void Awake()
 {
     if (SceneInstance == null)
     {
         SceneInstance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Ejemplo n.º 4
0
        public PauseControl getPauseControl(string deviceId)
        {
            var c = pauseControl.Where(x => x.deviceId == deviceId).FirstOrDefault();

            if (c == null)
            {
                c = new PauseControl()
                {
                    deviceId = deviceId
                };
                pauseControl.Add(c);
            }
            return(c);
        }
Ejemplo n.º 5
0
    public void RespawnPlayer()
    {
        Time.timeScale = 1f;
        ScoreManager.IncrementPacketLossCount();
        GameObject.FindObjectOfType <DeathPanelControl> ().CloseDeathPanel();
        player.transform.position = transform.position;
        player.GetComponent <PlayerHealth>().FillHealth();

        PauseControl pc = GameObject.FindObjectOfType <PauseControl> ();

        if (pc.isPanelOpen)
        {
            pc.ClosePauseMenu();
        }
    }
Ejemplo n.º 6
0
    private void Awake()
    {
        if (GameObject.Find("GlobalPersistence"))
        {
            Destroy(GameObject.Find("Persistence"));
            return;
        }

        pc         = GameObject.Find("Player").GetComponent <PlayerController>();
        ui         = GameObject.Find("UI");
        transition = GameObject.Find("Transition").GetComponent <Animator>();
        pause      = GetComponent <PauseControl>();
        persist    = GameObject.Find("Persistence");

        persist.name          = "GlobalPersistence";
        pc.transform.position = GameObject.Find("PlayerStart").transform.position;
    }
        public void ExecCommand(IFrameCommand cmd)
        {
            if (this.PauseCommand == 2)
            {
                Singleton <FrameSynchr> .GetInstance().PauseCancelCount--;
            }
            PauseControl pauseControl = Singleton <CBattleSystem> .GetInstance().pauseControl;

            if (pauseControl != null)
            {
                pauseControl.ExecPauseCommand(this.PauseCommand, this.PauseByCamp, this.CampPauseTimes);
                if (this.PauseCommand == 1 && Singleton <FrameSynchr> .GetInstance().PauseCancelCount > 0)
                {
                    Singleton <FrameSynchr> .GetInstance().SetSynchrRunning(true);
                }
            }
        }
Ejemplo n.º 8
0
 public override void Callback()
 {
     PauseControl.Pause(toPause);
 }
Ejemplo n.º 9
0
 private void OnEnable()
 {
     //Do not use with Awake (they do the same sort of)
     Instance = this;
 }