public void Setup(PublicEnums.Enemys enemy, bool shield, bool armor, Vector3 startPos, float duration) {
useCounter++;
//Debug.Log("Setup Sprite: " + myID);
myRoot.localPosition = startPos;
mySprite.spriteName = SpriteUtils.getEnemyIconName(enemy);
//Shield and Armor
if (armor) {
mySprite.color = Managers.PrefabManager.ui_armorColor;
}
if (shield) {
myShield.SetActive(true);
}
isUsed = true;
mySprite.enabled = true;
myTweener.SetStartToCurrentValue();
myTweener.duration = duration;
myTweener.from = startPos;
myTweener.to = myEndPos;
//myTweener.ResetToBeginning();
//Debug.Log("Setup " + myID + ": start: " + startPos + ", duration: " + duration);
}
public void StartTween() {
Debug.Log("Setup " + myID + ", pos: " + myRoot.localPosition + ": start: " + myTweener.from + ", end : " + myTweener.to + ", duration: " + myTweener.duration);
//myTweener.ResetToBeginning();
myTweener.PlayForward();
//myTweener.ResetToBeginning();
}
public void onTweenFinished() {
myTweener.ResetToBeginning();
Debug.Log("OnTweenFinished: " + myID);
isUsed = false;
mySprite.enabled = false;
myRoot.localPosition = Vector3.zero;
myShield.SetActive(false);
mySprite.color = Color.white;
}