// Use this for initialization
    void Awake()
    {
        enemyList = GameObject.Find("EnemyList");
        fogList   = GameObject.Find("FogList");
        player    = GameObject.Find("Player");
        if (GameObject.Find("Map_Creator") != null)
        {
            mapControl = GameObject.Find("Map_Creator").GetComponent <MapCreation>();
        }

        playerControl = player.GetComponent <PlayerController>();
    }
示例#2
0
    // Use this for initialization
    void Awake()
    {
        MapObject       = GameObject.Find("Map_Creator");
        TheGreatCreator = MapObject.GetComponent <MapCreation>();

        //Sets initial main values
        if (type == WalkerType.Main)
        {
            InitializeValues();
        }

        if (type == WalkerType.Child)
        {
            MainWalker = GameObject.Find("MainWalker");
        }
    }
示例#3
0
    // Fills the rest of nulls with ocean water
    void FillOcean()
    {
        MapCreation mc = MapCreation.instance;

        for (int x = mc.referencePoint.x; x < mc.bottomReferencePoint.x; x++)
        {
            for (int y = mc.referencePoint.y; y > mc.bottomReferencePoint.y; y--)
            {
                Vector2 check = new Vector2(x, y);
                // if is a tile that is neither perimeter or body
                if (!TileGroup.perimeterPositions.Contains(check) && !TileGroup.bodyPositions.Contains(check))
                {
                    Instantiate(Settings.instance.oceanPrefab, check, Quaternion.identity, transform);
                }
            }
        }
    }
示例#4
0
    //AudioManager aScript;

    // Use this for initialization
    void Start()
    {
        int x = 20;
        int y = 40;

        GameObject turnMan     = Instantiate(tmanager);
        GameObject mapCreator  = Instantiate(mcreator);
        GameObject unitCreator = Instantiate(ucreator);
        GameObject inputMan    = Instantiate(imanager);

        //GameObject audioMan = Instantiate (amanager);
        tScript         = turnMan.GetComponent <TurnManagerScript> ();
        mScript         = mapCreator.GetComponent <MapCreation> ();
        uScript         = unitCreator.GetComponent <UnitCreator> ();
        iScript         = inputMan.GetComponent <InputManagerScript> ();
        uScript.mapSize = new Vector2(20, 40);

        int[,] map = new int [x, y];
        for (int i = 0; i < x; ++i)
        {
            for (int j = 0; j < y; ++j)
            {
                if (i == 0 || i == x - 1 || j == 0 || j == y - 1)
                {
                    map [i, j] = 0;
                }
                else
                {
                    map [i, j] = Random.Range(1, 4);
                }
            }
        }
        //just to test
        map [10, 10] = -1;
        map [10, 20] = -1;
        mScript.setMatrix(map, x, y, new Vector3(45, -45, 0), 0.8f, Color.white);

        uScript.tutorialUnits();
        turnMan.GetComponent <TurnManagerScript> ().unitMap  = uScript.getUnitMap();
        turnMan.GetComponent <TurnManagerScript> ().unitList = uScript.getUnitLists();
        tScript.mapSize = new Vector2(20, 40);
        tScript.terrain = map;
        inputMan.GetComponent <InputManagerScript> ().setTurnMan(tScript);
        inputMan.GetComponent <InputManagerScript> ().setMapCreat(mScript);
    }
示例#5
0
 public Node Build()
 {
     MapCreation.Build();
     return(this);
 }
示例#6
0
 private void Awake()
 {
     sr      = GetComponent <SpriteRenderer>();
     manager = GameObject.Find("PlayerManager").GetComponent <PlayerManager>();
     Map     = GameObject.Find("MapCreation").GetComponent <MapCreation>();
 }
示例#7
0
 public void setMapCreat(MapCreation s)
 {
     mc = s;
 }
示例#8
0
    //(0, 0)
    //+--------------+
    //|              |
    //|              |
    //|              |
    //+--------------+ (mapSize.x, mapSize.y)

    private void Awake()
    {
        instance = this;
    }
 // Use this for initialization
 void Awake()
 {
     mapScript     = GameObject.Find("Map_Creator").GetComponent <MapCreation>();
     playerControl = GameObject.Find("Player").GetComponent <PlayerController>();
     gameControl   = GameObject.Find("GameController").GetComponent <GameController>();
 }