Muudatused
This commit is contained in:
@@ -11,6 +11,12 @@ public class MüntideLugeja : MonoBehaviour
|
||||
public void AnnaMünte(int arv)
|
||||
{
|
||||
this.arv += arv;
|
||||
textMeshProUGUI.text = this.arv + " $";
|
||||
textMeshProUGUI.text = this.arv + "";
|
||||
}
|
||||
|
||||
public void Nulli()
|
||||
{
|
||||
this.arv = 0;
|
||||
textMeshProUGUI.text = this.arv + "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,4 @@ public class pahalane : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class player : MonoBehaviour
|
||||
{
|
||||
@@ -84,7 +85,7 @@ public class player : MonoBehaviour
|
||||
var targetFollower = GetComponent<TargetFollower>();
|
||||
if (targetFollower.kaesolevAsi == null) return;
|
||||
var müntideArv = targetFollower.kaesolevAsi.GetComponent<Kast>().müntideArv;
|
||||
FindObjectOfType<MüntideLugeja>().AnnaMünte(müntideArv);
|
||||
//FindObjectOfType<MüntideLugeja>().AnnaMünte(müntideArv);
|
||||
Destroy(targetFollower.kaesolevAsi.gameObject);
|
||||
|
||||
for (var i = 0; i < müntideArv; i++)
|
||||
@@ -92,14 +93,18 @@ public class player : MonoBehaviour
|
||||
var münt = Instantiate(mündiEffekt, transform.position, Quaternion.identity);
|
||||
//münt.transform.localScale = Vector3.zero;
|
||||
var seq = DOTween.Sequence();
|
||||
seq.Append(münt.transform.DOScale(Vector3.one, i).SetEase(Ease.InOutQuad));
|
||||
seq.Append(münt.transform.DOMove(mündiMinekuAsukoht.position, 0.3f + (i * 0.1f)).SetEase(Ease.InOutQuad));
|
||||
var tf = münt.AddComponent<TargetFollower>();
|
||||
tf.kiirus = 5f - i * (0.5f);
|
||||
tf.kasi = mündiMinekuAsukoht;
|
||||
tf.kaesolevAsi = münt.transform;
|
||||
Destroy(münt, 5f - i * (0.5f));
|
||||
//tf.kiirus = 2f + i * (1f);
|
||||
//tf.kasi = mündiMinekuAsukoht;
|
||||
//tf.kaesolevAsi = münt.transform;
|
||||
//seq.Append(münt.transform.DOScale(Vector3.one, i).SetEase(Ease.InOutQuad));
|
||||
//seq.Append(münt.transform.DOScale(Vector3.zero, i).SetEase(Ease.InOutQuad)).OnComplete(() => { Destroy(münt); });
|
||||
seq.Append(münt.transform.DOShakeRotation(0.2f).SetEase(Ease.InOutQuad).OnStart(() => {
|
||||
tf.kiirus = 10f;
|
||||
tf.kasi = mündiMinekuAsukoht;
|
||||
tf.kaesolevAsi = münt.transform;
|
||||
}));
|
||||
seq.OnComplete(() => { Destroy(münt); FindObjectOfType<MüntideLugeja>().AnnaMünte(1); });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -107,8 +112,8 @@ public class player : MonoBehaviour
|
||||
|
||||
public void Surm()
|
||||
{
|
||||
|
||||
transform.position = new Vector3(-78, 1138, 0);
|
||||
FindObjectOfType<MüntideLugeja>().Nulli();
|
||||
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user