コード例 #1
0
    void Awake()
    {
        owner          = "N/A";
        lands          = new List <Environment>();
        gameController = GameObject.Find("GameController").GetComponent <GameController>();
        position       = new Vector2();
        armyTable      = new Hashtable();
        army           = Resources.Load("Prefabs/Army") as GameObject;
        GameObject uiBankObject = GameObject.Find("UIBank") as GameObject;

        uiBank       = uiBankObject.GetComponent <UIBank> ();
        storedArmies = new List <Army> ();
        armies       = new List <Army>();

        type = "city";

        // pick a random color
        float R        = Random.Range(.4f, .9f);
        float G        = Random.Range(.4f, .9f);
        float B        = Random.Range(.4f, .9f);
        Color newColor = new Color(R, G, B, 1.0f);

        // apply it on current object's material
        GetComponent <Renderer>().material.color = newColor;

        NameWizard nameWizard = GameObject.Find("NameWizard").GetComponent <NameWizard>();

        name       = nameWizard.GenerateCityName();
        leader     = new Character();
        population = Random.Range(10000, 15000);
        muns       = population / 3;
        food       = population + (population / 3);
    }
コード例 #2
0
    // Use this for initialization
    void Awake()
    {
        GameObject uiBankObject = GameObject.Find("UIBank") as GameObject;

        uiBank     = uiBankObject.GetComponent <UIBank>();
        isOccupied = false;
    }
コード例 #3
0
ファイル: GameController.cs プロジェクト: angsamuel/Campaign
 // Use this for initialization
 void Start()
 {
     CreateWorld();
     uiBank = GameObject.Find("UIBank").GetComponent <UIBank> ();
     uiBank.OpenInfoPanel();
     gameReady = true;
     grid [(int)playerCity.GetComponent <City> ().position.x, (int)playerCity.GetComponent <City> ().position.y].GetComponent <Tile> ().SelectTile();
     uiBank.munText.text  = playerCity.GetComponent <City>().muns.ToString();
     uiBank.foodText.text = playerCity.GetComponent <City>().food.ToString();
 }
コード例 #4
0
ファイル: GameController.cs プロジェクト: angsamuel/Doomsayer
 void Awake()
 {
     coords          = new  List <Vector2> ();
     uiBank          = GameObject.Find("UIBank").GetComponent <UIBank> ();
     environmentBank = GameObject.Find("EnvironmentBank").GetComponent <EnvironmentBank>();
     daysLeft        = 365;
     timeOfDay       = TimeOfDay.Midnight;
     playerParty     = playerPartyObject.GetComponent <Party>();
     //AIParties = new List<GameObject> ();
     tileGrid        = new GameObject[0];
     environmentGrid = new GameObject[0];
     ChangeLevel(LevelType.Fields);
 }
コード例 #5
0
 // Use this for initialization
 void Awake()
 {
     uiBank      = GameObject.Find("UIBank").GetComponent <UIBank> ();
     playerParty = playerPartyObject.GetComponent <Party> ();
 }
コード例 #6
0
ファイル: MainPanelScript.cs プロジェクト: angsamuel/Campaign
 // Use this for initialization
 void Start()
 {
     uiBank = GameObject.Find("UIBank").GetComponent <UIBank> ();
 }
コード例 #7
0
    void Awake()
    {
        GameObject u = GameObject.Find("UIBank") as GameObject;

        uiBank = u.GetComponent <UIBank> ();
    }
コード例 #8
0
 void Awake()
 {
     uiBank         = GameObject.Find("UIBank").GetComponent <UIBank>();
     gameController = GameObject.Find("GameController").GetComponent <GameController>();
 }