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(); } }); }
// Update is called once per frame void Update() { if (UIStatic.HasInt(UIStatic.MONEY)) { moneyText.text = UIStatic.GetInt(UIStatic.MONEY).ToString(); } }
// 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; } }
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(); } } }
void Start() { singleton = this; }
private void Update() { UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power); }
void Start() { InitWorkTargets(); UIStatic.SetInt(UIStatic.MAX_SACRIFICE, goalPower); UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power); }
private void Awake() { UIStatic.Init(); }
private void UpdateCubosUI() { UIStatic.SetInt(UIStatic.CUR_CUBOS, m_curCuboCount); }
public void UpdateMoneyUI() { UIStatic.SetInt(UIStatic.MONEY, m_curUIMoney); }