//AWAKE, START, UPDATE...______________________________________________________________________________________________ void Awake() { curPv = maxPv; hpUI = GameObject.Find("HpSlider").GetComponent <Slider> (); uiManager = GameObject.Find("UI_Canvas").GetComponent <UIGameManager> (); camera = GameObject.FindWithTag("MainCamera").GetComponent <CameraManager> (); hpUI.value = (curPv / maxPv); }
public void RefreshTime() { var total_time = (Helper.GetUtcTime() - DateTime.Parse(PlayerData._LastTimeSpinLucky)).TotalSeconds; if (total_time <= 0) { total_time = 0; } if (total_time > GameConfig.NextTimeWaitingForSpin * GameConfig.MaxNumberTurnForSpin) { total_time = GameConfig.NextTimeWaitingForSpin * GameConfig.MaxNumberTurnForSpin; } var number_turn = (int)(total_time - total_time % GameConfig.NextTimeWaitingForSpin) / GameConfig.NextTimeWaitingForSpin; PlayerData._LastNumberTurnSpin = Mathf.Clamp(PlayerData._LastNumberTurnSpin + number_turn, 0, GameConfig.MaxNumberTurnForSpin); PlayerData.SaveNumberTurnSpin(); total_time = GameConfig.NextTimeWaitingForSpin - total_time; if (PlayerData._LastNumberTurnSpin == GameConfig.MaxNumberTurnForSpin) { total_time = 0; } if (PlayerData._LastNumberTurnSpin < GameConfig.MaxNumberTurnForSpin && total_time <= 0) { total_time = GameConfig.NextTimeWaitingForSpin; PlayerData._LastTimeSpinLucky = Helper.GetUtcTimeString(); PlayerData.SaveLastTimeSpinLucky(); } if (PlayerData._LastNumberTurnSpin > 0) { if (UIGameManager.InstanceAwake() != null) { UIGameManager.Instance.EnableLuckyWheel(); } } else { if (UIGameManager.InstanceAwake() != null) { UIGameManager.Instance.DisableLuckyWheel(); } } _TimeForWaiting = (int)total_time; _IsReadyUpdate = _TimeForWaiting > 0 || PlayerData._LastNumberTurnSpin < GameConfig.MaxNumberTurnForSpin; _UiWheelLucky.RefreshTimeSpin(_IsReadyUpdate); _UiWheelLucky.UpdateTimeNextSpin(Helper.ConvertToTime(_TimeForWaiting)); _UiWheelLucky.RefreshUINumberSpin(); }
//AudioSource audioSource; public override void Start() { base.Start(); uiGame = FindObjectOfType <UIGameManager>(); startMaterial = GetComponentInChildren <MeshRenderer>().material; //audioSource = gameObject.AddComponent<AudioSource>(); }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); npcMouseOverLocation = transform; // so it starts as something... just a simple work around }
void Start() { // Turn off the cursor Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; //cam.SetReplacementShader(shader, "RenderType"); //player = GetComponent<CharacterController>(); m_uiGame = FindObjectOfType <UIGameManager>(); audioManager = FindObjectOfType <AudioManager>(); // TODO Freeze Rigidbody's X and Z rotation from code. }
void Awake() { uimgr = UIGameManager.instance; }
// Start is called before the first frame update public virtual void Start() { uiGame = FindObjectOfType <UIGameManager>(); }
private void Awake() { UIgame1 = UIgame; loadingUI1 = loadingUI; ins = this; }
// Start is called before the first frame update override public void Start() { base.Start(); m_InitialDoorRotation = transform.rotation; m_uiGame = FindObjectOfType <UIGameManager>(); }
// Use this for initialization void Start() { ui = UIGameManager.instance; isMouseOver = false; }
// Use this for initialization void Start() { ui = UIGameManager.instance; }