コード例 #1
0
//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);
    }
コード例 #2
0
    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();
    }
コード例 #3
0
ファイル: AudioTape.cs プロジェクト: PixelDough/FPS_Horror
    //AudioSource audioSource;

    public override void Start()
    {
        base.Start();

        uiGame = FindObjectOfType <UIGameManager>();

        startMaterial = GetComponentInChildren <MeshRenderer>().material;

        //audioSource = gameObject.AddComponent<AudioSource>();
    }
コード例 #4
0
    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
    }
コード例 #5
0
    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.
    }
コード例 #6
0
 void Awake()
 {
     uimgr = UIGameManager.instance;
 }
コード例 #7
0
ファイル: Interactive.cs プロジェクト: PixelDough/FPS_Horror
 // Start is called before the first frame update
 public virtual void Start()
 {
     uiGame = FindObjectOfType <UIGameManager>();
 }
コード例 #8
0
 private void Awake()
 {
     UIgame1    = UIgame;
     loadingUI1 = loadingUI;
     ins        = this;
 }
コード例 #9
0
 // Start is called before the first frame update
 override public void Start()
 {
     base.Start();
     m_InitialDoorRotation = transform.rotation;
     m_uiGame = FindObjectOfType <UIGameManager>();
 }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     ui          = UIGameManager.instance;
     isMouseOver = false;
 }
コード例 #11
0
ファイル: NPCTalk.cs プロジェクト: EdanSmith/Fishtale-Scripts
 // Use this for initialization
 void Start()
 {
     ui = UIGameManager.instance;
 }