public void UpdateBehaviour(Mercenary merc) { behaviour = merc.Copy(); if (waiting != null) { waiting.UpdateBehaviour(behaviour.Copy()); } }
public void UpdateBehaviour(Mercenary merc) { if (!inPlay()) { behaviour = merc.Copy(); behaviour.Initialize(); GetComponent <MercenaryRepresenter>().SetBehaviour(behaviour); } }
public MercTrayElement AddMercTrayElement(Mercenary toAdd) { GameObject summoned = GameObject.Instantiate(mercTrayElementPrefab, Vector3.zero, Quaternion.identity, transform); MercTrayElement elem = summoned.GetComponentInChildren <MercTrayElement>(); elem.behaviour = toAdd.Copy(); return(elem); }
void Summon(Mercenary merc, MercSlot slot) { GameObject instance = GameObject.Instantiate(mercElementPrefab, Vector3.zero, Quaternion.identity); MercenaryRepresenter mr = instance.GetComponent <MercenaryRepresenter>(); slot.occupying = merc.Copy(); mr.SetBehaviour(slot.occupying); mr.transform.SetParent(slot.transform); mr.transform.localPosition = new Vector3(0, 0, 0); slot.attackProgress = -1000.0f; StartCoroutine(Deploy(slot)); }
void OnCountChange() { if (waiting == null && count > 0) { GameObject created = GameObject.Instantiate(deployedMercPrefab, transform); waiting = created.GetComponent <DeployedMerc>(); waiting.behaviour = behaviour.Copy(); waiting.parent = this; } else if (waiting != null && count <= 0) { Destroy(waiting.gameObject); waiting = null; } }