public void DieThisWay(string trig)
{
int t = 0;
if (trig == null) return;
if (trig.Contains("Clone"))
{
trig = trig.Replace("(Clone)", "");
}
foreach (string trigger in deathAnimators.triggers)
{
if (trigger == trig)
{
dieThisWaySet = true;
string runThis = deathAnimators.deaths.ElementAt(t);
RunAssociatedEffect(trig, true);
RunAssociatedMaterial(runThis);
animator.SetBool(runThis, true);
if (runThis == "Gold" || runThis == "Crystal" || runThis == "crystal")
{
BecomeFrozen(runThis);
}
else if (runThis == "torch-flicker")
{
return;
}
else
{
Debug.Log("Dead now");
gameObject.layer = LayerMask.NameToLayer("Dying");
}
//SetAdditionalParameters();
//return;
}
t++;
}
}
Leave a Reply