private GameObject createTeleport(Transform transform, Vector2 target) { GameObject obj = Instantiate(teleportTemplate) as GameObject; Teleport teleport = obj.GetComponent <Teleport>(); teleport.Init(transform, target); teleport.OnUsed += teleportPlayer; return(obj); }
public float TeleportMe(float[] stats) //(float aff, float where) { if (teleport == null) { teleport = gameObject.AddComponent <Teleport>() as Teleport; teleport.Init(this); } modified_defenses = true; float def = teleport.TeleportMe(stats); IncrementDefense(EffectType.Teleport, def); return(def); }