Exemplo n.º 1
0
        public void CreateTrapPrevu()
        {
            Trap trap = Traps[(int)SelectedTrapType];

            trap.IsInPreviewMode = true;
            GameObject trapGameObject = trap.TrapPrefab;

            trapGameObject.transform.position = GetCursorPosition();
            trapGameObject = Instantiate(trapGameObject);
            ActualTrap     = (Trap)trapGameObject.GetComponentInChildren(trap.GetType());
        }
Exemplo n.º 2
0
    protected override void ApplyTo(Tile source, IEnumerable <Tile> tiles, IReadOnlyDictionary <Id, List <CastArgs> > args)
    {
        foreach (var tile in tiles)
        {
            if (!tile.Entities.Any(tileable => tileable is Trap))
            {
                var direction = Vector3.Normalize(source.GetWorldPosition() - Player.Active.Navigator.Current.GetWorldPosition());
                SpawnAt(tile, direction.xy().ComputeOrientation());
            }
            else if (tile.Entities.Any(tileable => tileable.GetType() == prefab.GetType()))
            {
                TryFindSpawnPoint(tile, Vector2Int.down);
                TryFindSpawnPoint(tile, Vector2Int.right);
                TryFindSpawnPoint(tile, Vector2Int.left);
                TryFindSpawnPoint(tile, Vector2Int.up);
            }
        }

        End();
    }
Exemplo n.º 3
0
 private string GetTrappedState()
 {
     return("trapped" + _trap.GetType().Name);
 }