public void setActions(List <Action> actions, IActionReceiver receiver = null) { this.actions = actions; this.quadrant = getQuadrant(); this.receiver = receiver; regenerate(); }
public virtual void Setup(BaseCreature creatureData) { data = creatureData; data.currentHp = data.hp; rb = GetComponent <Rigidbody2D>(); rb.angularDrag = data.angularDrag; rb.drag = data.drag; rb.mass = data.mass; var coll = GetComponent <Collider2D>(); var mat = new PhysicsMaterial2D(); mat.bounciness = data.bounciness; mat.friction = data.friction; coll.sharedMaterial = mat; transform.localScale = Vector3.one * creatureData.scale; view.sprite = SpriteBase.GetSprite(data.view + data.teamId); teamId = data.teamId; progressBar.gameObject.SetActive(true); if (data.Action != null) { actionReceiver = gameObject.AddComponent(data.Action.GetType()) as IActionReceiver; actionReceiver.Setup(data.Action as IActionReceiver); } if (data.HitAction != null) { hitActionReceiver = gameObject.AddComponent(data.HitAction.GetType()) as IActionReceiver; hitActionReceiver.Setup(data.HitAction as IActionReceiver); } MatchManager.OnEndTurn += OnEndTurn; }
public void setAction(Action action, IActionReceiver actionReceiver = null) { var buttonMB = this.button.GetComponent <ButtonMB>(); buttonMB.Action = action; buttonMB.Receiver = actionReceiver; }
public void Setup(IActionReceiver other) { var pref = other as RailShot; width = pref.width; affectType = pref.affectType; damage = pref.damage; }
public void Setup(IActionReceiver other) { var pref = other as Shield; radius = pref.radius; shield = pref.shield; force = pref.force; liveLengthInTurns = pref.liveLengthInTurns; }
public void Setup(IActionReceiver other) { var pref = other as AreaDamage; affectType = pref.affectType; radius = pref.radius; damage = pref.damage; force = pref.force; }
public void Setup(IActionReceiver other) { var pref = other as Shoot; quanity = pref.quanity; coneAngle = pref.coneAngle; bolid = pref.bolid; bolid.teamId = GetComponent <Creature>().data.teamId; }
public void Setup(BaseSpell data) { if (data.Action != null) { actionReceiver = gameObject.AddComponent(data.Action.GetType()) as IActionReceiver; actionReceiver.Setup(data.Action as IActionReceiver); actionReceiver.Action(transform.position, 0f); } }
//################################################################# //################################################################# //################################################################# #region Misc public void showActions(List <Action> actions, Vector2 position, IActionReceiver actionReceiver = null) { Vector3 pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); var mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition); MenuMB.Instance.transform.position = new Vector3(pos.x, pos.y, pos.z) + mouseRay.direction.normalized * 10; MenuMB.Instance.transform.rotation = Camera.main.transform.rotation; MenuMB.Instance.setActions(actions, actionReceiver); MenuMB.Instance.show(); // TODO why isnt position used? //this.clicked_on = position; }
public void Setup(IActionReceiver other) { var pref = other as AreaBuff; radius = pref.radius; affectType = pref.affectType; modifiers = new PropertyModifier[pref.modifiers.Length]; for (int i = 0; i < pref.modifiers.Length; i++) { modifiers[i] = pref.modifiers[i].Clone(); } }
public GameAction(ActionType actionType, IActionReceiver actionReceiver) { this.ActionReceiver = actionReceiver; this.ActionType = actionType; }
public void Setup(IActionReceiver other) { }
public virtual IGameAction GetAction(ActionType actionType, IActionReceiver actionReceiver) { var action = new KeyValuePair<ActionType, IActionReceiver>(actionType, actionReceiver); return _ActionsCache.GetOrAdd(action, this.CreateAction); }
public DefaultGameAction(ActionType actionType, IActionReceiver actionReceiver) : base(actionType, actionReceiver) { }