示例#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
 private void Update()
 {
     UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power);
 }
示例#3
0
 private void UpdateCubosUI()
 {
     UIStatic.SetInt(UIStatic.CUR_CUBOS, m_curCuboCount);
 }
示例#4
0
 void Start()
 {
     InitWorkTargets();
     UIStatic.SetInt(UIStatic.MAX_SACRIFICE, goalPower);
     UIStatic.SetInt(UIStatic.CUR_SACRIFICE, power);
 }
示例#5
0
 public void UpdateMoneyUI()
 {
     UIStatic.SetInt(UIStatic.MONEY, m_curUIMoney);
 }