예제 #1
0
    public override void OnWork(CuboController user)
    {
        PlayerCommands.Get().OnCuboDestroyed();
        user.GetComponentInChildren <Selectable>().enabled = false;

        GameObject model = user.model;

        model.transform.DOPunchScale(new Vector3(1.025f, 0.8f, 1.025f), 0.25f, 0, 2f);

        Sequence seq = DOTween.Sequence();

        seq.Append(model.transform.DOLocalMoveY(5f, sacrificeTime).SetEase(Ease.InQuad));
        seq.Join(model.transform.DOScale(0f, sacrificeTime - 0.4f).SetEase(Ease.InQuad).SetDelay(0.4f));
        seq.Play();

        Camera.main.GetComponent <AudioSource>().PlayOneShot(sacrificeNoise);

        Timing.CallDelayed(sacrificeTime + 0.1f, delegate
        {
            Instantiate(workFxObj, transform.position + Vector3.up * 17f, Quaternion.LookRotation(Vector3.up, Vector3.left));
            power++;
            UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power);
            Destroy(user.gameObject);

            if (power >= goalPower)
            {
                PlayerCommands.Get().Win();
            }
        });
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (UIStatic.HasInt(UIStatic.MONEY))
     {
         moneyText.text = UIStatic.GetInt(UIStatic.MONEY).ToString();
     }
 }
예제 #3
0
 // Update is called once per frame
 void Update()
 {
     if (UIStatic.HasInt(UIStatic.CUR_CUBOS))
     {
         text.text = UIStatic.GetInt(UIStatic.CUR_CUBOS).ToString();
     }
     if (!PlayerCommands.Get().EnoughRoomForCubos())
     {
         label.color = flashRedColor;
         text.color  = flashRedColor;
     }
     else
     {
         label.color = m_textStartColor;
         text.color  = m_textStartColor;
     }
 }
예제 #4
0
    void Update()
    {
        if (UIStatic.HasInt(UIStatic.MAX_SACRIFICE))
        {
            goalText.text = UIStatic.GetInt(UIStatic.MAX_SACRIFICE).ToString();
        }

        if (UIStatic.HasInt(UIStatic.CUR_SACRIFICE))
        {
            currentSacrificeText.text = UIStatic.GetInt(UIStatic.CUR_SACRIFICE).ToString();
        }

        if (UIStatic.HasInt(UIStatic.CUR_SACRIFICE) && UIStatic.HasInt(UIStatic.MAX_SACRIFICE))
        {
            if (UIStatic.GetInt(UIStatic.CUR_SACRIFICE) >= UIStatic.GetInt(UIStatic.MAX_SACRIFICE) - 10)
            {
                FlashColor();
            }
        }
    }
예제 #5
0
 void Start()
 {
     singleton = this;
 }
예제 #6
0
 private void Update()
 {
     UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power);
 }
예제 #7
0
 void Start()
 {
     InitWorkTargets();
     UIStatic.SetInt(UIStatic.MAX_SACRIFICE, goalPower);
     UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power);
 }
예제 #8
0
 private void Awake()
 {
     UIStatic.Init();
 }
예제 #9
0
 private void UpdateCubosUI()
 {
     UIStatic.SetInt(UIStatic.CUR_CUBOS, m_curCuboCount);
 }
예제 #10
0
 public void UpdateMoneyUI()
 {
     UIStatic.SetInt(UIStatic.MONEY, m_curUIMoney);
 }