Ejemplo n.º 1
0
            public obj.IDestroyable FindNearestDestroyable(Vector3 from, obj.Types.Side side)
            {
                List <lr.obj.IDestroyable> destroyables = core.GOUtils.FindObjectsOfInterface <lr.obj.IDestroyable> ();

                List <lr.obj.IDestroyable> sortedDestroyables = new List <lr.obj.IDestroyable> (destroyables.FindAll(x => x.Side == side && x.Hp > 0));

                sortedDestroyables.Sort(delegate(lr.obj.IDestroyable x, lr.obj.IDestroyable y) {
                    if ((x.Position - from).sqrMagnitude < (y.Position - from).sqrMagnitude)
                    {
                        return(-1);
                    }

                    return(1);
                });

                return(sortedDestroyables.Count > 0 ? sortedDestroyables [0] : null);
            }
Ejemplo n.º 2
0
            public obj.CharacterVisual CreateCharacterBattleVisual(data.CharacterInstance fromInstance, battle.Context context, obj.Types.Side side)
            {
                GameObject visualGo = GameObject.Instantiate(fromInstance.BattleVisual) as GameObject;

                obj.CharacterVisual visual = visualGo.GetComponent <obj.CharacterVisual> ();

                visual.Init(context, fromInstance, side);

                return(visual);
            }
Ejemplo n.º 3
0
            public void ReleaseCharacter(data.CharacterInstance charInstance, obj.Types.Side side)
            {
                obj.CharacterVisual charVisual = BattleFactory.CreateCharacterBattleVisual(charInstance, new Context(this), side);

                charVisual.Init();
            }
Ejemplo n.º 4
0
            public void ReleaseMissile(data.MissileInstance missileInstance, obj.Types.Side side)
            {
                obj.MissileVisual missileVisual = BattleFactory.CreateMissileBattleVisual(missileInstance, new Context(this), side);

                missileVisual.Init();
            }
Ejemplo n.º 5
0
 public obj.Tower GetTower(obj.Types.Side side)
 {
     return(Towers[(int)side]);
 }