public void setActions(List <Action> actions, IActionReceiver receiver = null)
 {
     this.actions  = actions;
     this.quadrant = getQuadrant();
     this.receiver = receiver;
     regenerate();
 }
예제 #2
0
파일: Creature.cs 프로젝트: xdegtyarev/bowl
    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;
    }
예제 #3
0
        public void setAction(Action action, IActionReceiver actionReceiver = null)
        {
            var buttonMB = this.button.GetComponent <ButtonMB>();

            buttonMB.Action   = action;
            buttonMB.Receiver = actionReceiver;
        }
예제 #4
0
파일: RailShot.cs 프로젝트: xdegtyarev/bowl
    public void Setup(IActionReceiver other)
    {
        var pref = other as RailShot;

        width      = pref.width;
        affectType = pref.affectType;
        damage     = pref.damage;
    }
예제 #5
0
파일: Shield.cs 프로젝트: xdegtyarev/bowl
    public void Setup(IActionReceiver other)
    {
        var pref = other as Shield;

        radius            = pref.radius;
        shield            = pref.shield;
        force             = pref.force;
        liveLengthInTurns = pref.liveLengthInTurns;
    }
예제 #6
0
    public void Setup(IActionReceiver other)
    {
        var pref = other as AreaDamage;

        affectType = pref.affectType;
        radius     = pref.radius;
        damage     = pref.damage;
        force      = pref.force;
    }
예제 #7
0
    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;
    }
예제 #8
0
 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);
     }
 }
예제 #9
0
        //#################################################################
        //#################################################################
        //#################################################################
        #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;
        }
예제 #10
0
    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();
        }
    }
예제 #11
0
		public GameAction(ActionType actionType, IActionReceiver actionReceiver)
		{
			this.ActionReceiver = actionReceiver;
			this.ActionType = actionType;
		}
예제 #12
0
파일: Move.cs 프로젝트: xdegtyarev/bowl
 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)
		{
		}