Beispiel #1
0
    IGameTimer setupTimer(float maxTime, float timeStep)
    {
        GameObject timerObject = new GameObject();
        MonoTimer  timer       = timerObject.AddComponent <MonoTimer>();

        return(timer.Setup(maxTime, timeStep));
    }
Beispiel #2
0
    public void Start()
    {
        Instance      = this;
        timer         = gameObject.GetComponent <MonoTimer>();
        client        = new HttpClient();
        LoginPanel    = GameObject.Find("LoginPanel");
        usernameInput = GameObject.Find("UserNameInput").GetComponent <InputField>();
        passwordInput = GameObject.Find("PasswordInput").GetComponent <InputField>();
        infoLabel     = GameObject.Find("InfoLabel").GetComponent <Text>();

        PlayerPanel     = GameObject.Find("PlayerPanel");
        PlayerScroll    = GameObject.Find("PlayerScroll").GetComponent <ScrollRect>();
        createLabel     = GameObject.Find("CreateLabel").GetComponent <Text>();
        playerNameInput = GameObject.Find("PlayerNameInput").GetComponent <InputField>();
        LoadingPanel    = GameObject.Find("LoadingPanel");

        LoginButton.onClick.AddListener(Login);
        RegisterButton.onClick.AddListener(Register);
        QuitGameButton.onClick.AddListener(QuitGame);
        CreateButton.onClick.AddListener(Create);
        BackButton.onClick.AddListener(Back);
        LoginPanel.SetActive(true);
        PlayerPanel.SetActive(false);
        LoadingPanel.SetActive(false);
    }
Beispiel #3
0
 public static MonoTimer Init()
 {
     if (m_Instance == null)
     {
         GameObject go = new GameObject("MonoTimer");
         m_Instance = go.AddComponent <MonoTimer>();
         DontDestroyOnLoad(go);
     }
     return(m_Instance);
 }
Beispiel #4
0
 private void Awake()
 {
     if (Usersession.Instance != null)
     {
         CurrentPlayer = Usersession.Instance.player;
     }
     Timer = gameObject.AddComponent <MonoTimer>();
     Screen.SetResolution(800, 600, false);
     inputController = gameObject.AddComponent <InputController>();
     Instance        = this;
 }
Beispiel #5
0
    private void FixedUpdate()
    {
        GameObject fader = Instantiate(prefabTrail);

        fader.transform.position   = trans.position;
        fader.transform.rotation   = trans.rotation;
        fader.transform.localScale = trans.lossyScale;
        fader.GetComponent <SpriteRenderer>().sprite = accessor.Get();
        MonoTimer fadeTimer = fader.GetComponent <MonoTimer>();

        fadeTimer.SetSecondsTarget(secondsToFade);
        fadeTimer.Run();
    }