Ejemplo n.º 1
0
 protected void Start()
 {
     if (_Tile == null)
     {
         _Tile = Tile_Manager.m_Tile_Manager;
     }
 }
Ejemplo n.º 2
0
    public Ship_Wheel(Vector3Int i_tile_pos, Tilemap i_tilemap) : base(i_tile_pos)
    {
        tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
        activation_cost = 5;

        ship_sys  = (Ship_System)(tm.Get_Systems(1));
        ship_grid = i_tilemap.GetComponentInParent <Grid>();

        if (ship_sys == null)
        {
            Debug.LogError("System not found in SHIP_WHEEL");
        }

        GameObject[] players = GameObject.FindGameObjectsWithTag("Player");

        foreach (var obj in players)
        {
            player_transforms.Add(obj.transform);
        }

        // Listeners
        Input_Manager.static_input["Use Wheel"].press_actions      += Use_Wheel;
        Input_Manager.static_input["Toggle Control"].press_actions += Toggle_Manual_Control;
        //
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     SpawnPoint = new Vector2[2];
     MAX        = 40;
     CreateTileMap();
     Board_Manager.m_Board_Manager.Loading++;
     m_Tile_Manager = this;
 }
Ejemplo n.º 4
0
    private void Start()
    {
        tm            = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
        ship_movement = ship_grid.GetComponent <Movement>();

        tm.Init_Ship_Systems();

        Find_Wheel();
    }
Ejemplo n.º 5
0
    // Start is called before the first frame update
    void Start()
    {
        tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();

        default_grid = place_tilemap.GetComponentInParent <Grid>();
        ship_grid    = alternate_place_tilemap.GetComponentInParent <Grid>();

        Init_Inventory_Slots();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        _Tile = GetComponent <Tile_Manager>();

        switch (Random.Range(0, 3))
        {
        case 0:
            if (_Tile.Y > _Tile.X)
            {
                _Directions = directions.East;
            }
            else
            {
                _Directions = directions.North;
            }
            break;

        case 1:
            if (_Tile.Y > _Tile.X)
            {
                _Directions = directions.West;
            }
            else
            {
                _Directions = directions.South;
            }
            break;

        case 2:
            if (_Tile.X > _Tile.Y)
            {
                _Directions = directions.North;
            }
            else
            {
                _Directions = directions.East;
            }
            break;

        case 3:
            if (_Tile.X > _Tile.Y)
            {
                _Directions = directions.South;
            }
            else
            {
                _Directions = directions.West;
            }
            break;
        }


        SpawnSpot();
        Board_Manager.m_Board_Manager.Loading++;
    }
Ejemplo n.º 7
0
    public override void Add_Tile(Vector3Int i_pos, TileBase i_tile)
    {
        Debug.Log("Tile added to energy");
        bool is_valid = false;

        if (tm == null)
        {
            tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
        }

        if (Check_Tiletype(system_tiles["Transmitters"], i_tile))
        {
            energy_dictionary.Add(i_pos, Create_Energy_Tile(i_tile));
            is_valid = true;
        }
        else if (Check_Tiletype(system_tiles["Generators"], i_tile))
        {
            Debug.Log("Generator Added");
            generator_dictionary.Add(i_pos, 1);
            is_valid = true;
        }
        else if (Check_Tiletype(system_tiles["Receptors"], i_tile))
        {
            Energy_Receptor input_receptor;

            if (tm.Check_Layer_Name(i_tile, "Wheel"))
            {
                input_receptor = new Ship_Wheel(i_pos, tm.Grab_Ship_Layer(i_tile));
            }
            else
            {
                if (is_ship_mode)
                {
                    input_receptor = new Door(i_pos, i_tile, tm.Grab_Ship_Layer(i_tile));
                }
                else
                {
                    input_receptor = new Door(i_pos, i_tile, tm.Grab_Layer(i_tile));
                }
            }

            receptor_dictionary.Add(i_pos, input_receptor);
            is_valid = true;
        }


        if (is_valid)
        {
            base.Add_Tile(i_pos, i_tile);
        }
        else
        {
            Debug.LogWarning("Invalid tile addition at:" + i_pos + " with " + i_tile);
        }
    }
Ejemplo n.º 8
0
    private void Awake()
    {
        playerAnim    = GetComponent <Animator>();
        coolDownImage = GameObject.FindGameObjectWithTag("DropAbility");
        coolDown      = 0;
        GameObject controlScripts = GameObject.Find("ControlScripts");

        tileManager    = controlScripts.GetComponent <Tile_Manager>();
        playerBody     = gameObject.GetComponent <Rigidbody>();
        playerCollider = gameObject.GetComponent <BoxCollider>();
        tileManager    = controlScripts.GetComponent <Tile_Manager>();
        hp             = 10;
    }
Ejemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        Char  = GetComponent <Player_Manager>();
        x     = Char.x;
        y     = Char.y;
        T     = transform.parent.GetComponent <Tile>();
        _Tile = T.transform.parent.GetComponent <Tile_Manager>();
        Camera.main.GetComponent <Input_Manager>().Tile_View();
        Behind_Ob = new List <Tile>();
        InView();

        Board_Manager.m_Board_Manager.Loading++;
    }
Ejemplo n.º 10
0
    // Start is called before the first frame update
    void Start()
    {
        tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();

        foreach (var tile_pos in wall_tilemap.cellBounds.allPositionsWithin)
        {
            if (Check_Tiletype(open_doors, wall_tilemap.GetTile(tile_pos)))
            {
                door_dictionary.Add(tile_pos, Create_Door_Tile(0, tile_pos));
                tm.Add_Tile(tile_pos, wall_tilemap.GetTile(tile_pos));
            }
        }
    }
Ejemplo n.º 11
0
 public override void Add_Tile(Vector3Int i_pos, TileBase i_tile)
 {
     tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
     if (tm.Check_Layer_Name(i_tile, "Spawner"))
     {
         if (!swarm_dictionary.ContainsKey(i_pos))
         {
             Spawner_Info temp_spawner_info = new Spawner_Info();
             temp_spawner_info.spread_percentage = 0.0f;
             temp_spawner_info.spread_speed      = Random.Range(1.0f, 3.0f);
             temp_spawner_info.tile = i_tile;
             swarm_dictionary.Add(i_pos, temp_spawner_info);
         }
     }
 }
Ejemplo n.º 12
0
    public void Start()
    {
        _Tile = transform.parent.GetComponent<Tile_Manager>();
        Obstacle_Manager = transform.parent.GetComponent<Obstacle_Manager>();
        Check = false;
        RealCost = -1;
        Highlighted = false;
        orginal_color = GetComponent<SpriteRenderer>().color;
        Prev_Highlighted = GetComponent<SpriteRenderer>().color;
        View_Check = false;
        Camera.main.GetComponent<Input_Manager>().Tile_View += LateStart;
		View_Char = new List<int>();
        Action = null;
        Board_Manager.m_Board_Manager.Loading++;
        _ReturnOriginal += ReturnOrginal;

    }
Ejemplo n.º 13
0
    protected void Start()
    {
        DynamicVisualAcuity = Random.Range(13, 20);
        Now_Action_Point    = Pull_Action_Point;
        Now_Move_Point      = Move_Point;

        UI_Manager = GameObject.Find("Canvas").GetComponent <UI_MANAGER>();
        Inventory  = GameObject.Find("Inventory").GetComponent <Inventory_Manager>();
        T          = transform.parent.GetComponent <Tile>();
        _Tile      = transform.parent.parent.GetComponent <Tile_Manager>();
        x          = T.X;
        y          = T.Y;

        Init();
        Board_Manager.m_Board_Manager.AddUnit(this);

        Board_Manager.m_Board_Manager.Loading++;
        Name = UI_Manager.EUFirstName[Random.Range(0, UI_Manager.EUFirstName.Length)] + " " + UI_Manager.EULastName[Random.Range(0, UI_Manager.EULastName.Length)];
    }
Ejemplo n.º 14
0
    public override void Remove_Tile(Vector3Int i_pos, TileBase i_tile)
    {
        if (tm == null)
        {
            tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
        }

        if (Check_Tiletype(system_tiles["Transmitters"], i_tile))
        {
            if (energy_dictionary.ContainsKey(i_pos))
            {
                energy_dictionary.Remove(i_pos);
            }
            else
            {
                Debug.LogWarning("Invalid tile removal at:" + i_pos + " with " + i_tile);
            }
        }
        else if (Check_Tiletype(system_tiles["Generators"], i_tile))
        {
            if (generator_dictionary.ContainsKey(i_pos))
            {
                generator_dictionary.Remove(i_pos);
            }
            else
            {
                Debug.LogWarning("Invalid tile removal at:" + i_pos + " with " + i_tile);
            }
        }
        else if (Check_Tiletype(system_tiles["Receptors"], i_tile))
        {
            if (receptor_dictionary.ContainsKey(i_pos))
            {
                receptor_dictionary[i_pos].Destroy();
                receptor_dictionary.Remove(i_pos);
            }
            else
            {
                Debug.LogWarning("Invalid tile removal at:" + i_pos + " with " + i_tile);
            }
        }
    }
Ejemplo n.º 15
0
    public override void Add_Tile(Vector3Int i_pos, TileBase i_tile)
    {
        tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
        if (!liquid_dictionary.ContainsKey(i_pos))
        {
            Liquid_Info temp_spawner_info = new Liquid_Info();
            temp_spawner_info.spread_percentage = 0.0f;
            temp_spawner_info.spread_speed      = Random.Range(1.0f, 3.0f);
            temp_spawner_info.tile = i_tile;

            if (spread_value_dictionary.ContainsKey(i_pos))
            {
                temp_spawner_info.liquid_amount = spread_value_dictionary[i_pos];
                spread_value_dictionary.Remove(i_pos);
            }
            else
            {
                temp_spawner_info.liquid_amount = 10.0f;
            }

            liquid_dictionary.Add(i_pos, temp_spawner_info);
        }
    }
Ejemplo n.º 16
0
    public Door(Vector3Int i_tile_pos, TileBase i_tiletype, Tilemap i_tilemap) : base(i_tile_pos)
    {
        tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();

        target_tilemap = i_tilemap;
        //open_door = tm.standard_door.inactive_tile;
        closed_door = i_tiletype;

        if (is_open)
        {
            //current_tile = open_door;
            target_tilemap.SetColor(position, new Color(1.0f, 1.0f, 1.0f, 0.3f));
        }
        else
        {
            //current_tile = closed_door;
            target_tilemap.SetColor(position, Color.white);
        }

        target_tilemap.SetTile(position, current_tile);

        tile_grid = target_tilemap.GetComponentInParent <Grid>();
    }
Ejemplo n.º 17
0
 // Start is called before the first frame update
 void Start()
 {
     tm = GameObject.FindGameObjectWithTag("TileManager").GetComponent <Tile_Manager>();
 }
Ejemplo n.º 18
0
    public override void BTN5()
    {
        if (Unit.Now_Action_Point < 4 || Action || Bullet == MaxBullet || MaxReload <= 0)
        {
            return;
        }
        Tile_Manager _Tile = GameObject.Find("MapTiles").GetComponent <Tile_Manager>();

        #region Unit_Ammuniation_Check
        if (_Tile.MY_Tile[Unit.x - 1][Unit.y].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.x - 1][Unit.y].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point -= 4;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        if (_Tile.MY_Tile[Unit.x + 1][Unit.y].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.x + 1][Unit.y].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point -= 4;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        if (_Tile.MY_Tile[Unit.x][Unit.y - 1].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.x][Unit.y - 1].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point -= 4;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        if (_Tile.MY_Tile[Unit.x][Unit.y + 1].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.x][Unit.y + 1].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point -= 4;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        #endregion
        #region Partner_Ammuniation_Check
        if (_Tile.MY_Tile[Unit.Partner.x - 1][Unit.Partner.y].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.Partner.x - 1][Unit.Partner.y].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point        -= 4;
                Unit.Partner.Now_Action_Point = Unit.Now_Action_Point;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        if (_Tile.MY_Tile[Unit.Partner.x + 1][Unit.Partner.y].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.Partner.x + 1][Unit.Partner.y].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point        -= 4;
                Unit.Partner.Now_Action_Point = Unit.Now_Action_Point;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        if (_Tile.MY_Tile[Unit.Partner.x][Unit.Partner.y - 1].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.Partner.x][Unit.Partner.y - 1].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point        -= 4;
                Unit.Partner.Now_Action_Point = Unit.Now_Action_Point;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        if (_Tile.MY_Tile[Unit.Partner.x][Unit.Partner.y + 1].transform.childCount > 0)
        {
            Transform Ammuniation_Soldier = _Tile.MY_Tile[Unit.Partner.x][Unit.Partner.y + 1].transform.Find("Player(Clone)");
            if (Ammuniation_Soldier != null && Ammuniation_Soldier.GetComponent <Unit_Manager>()._Class == Unit_Manager.Class.Ammuniation_Soldier)
            {
                Unit.Now_Action_Point        -= 4;
                Unit.Partner.Now_Action_Point = Unit.Now_Action_Point;
                Bullet = MaxBullet;
                Unit.DrawActionPoint();
                _UI._Clip.text = Bullet.ToString();
                return;
            }
        }
        #endregion
    }
Ejemplo n.º 19
0
 private void Awake()
 {
     instance = this;
     flagTest = false;
 }