Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     IsWalk = false;
     script = GameObject.Find("Grid").transform.Find("map").gameObject.GetComponent <MapSelectScript>();
     script.SetTileColor(transform.position, Constants.enemy_color);
     /*Debug.Log(Constants.enemy_color);*/
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     /*Debug.Log("player control !");*/
     script = GameObject.Find("Grid").transform.Find("map").gameObject.GetComponent <MapSelectScript>();
     if (name == "PlayerSoldier")
     {
         script.SetTileColor(transform.position, Constants.player_color);
     }
 }
Exemplo n.º 3
0
        private void LoadColor()
        {
            GameObject root = GameObject.Find("Grid");
            GameObject obj  = root.transform.Find("map").gameObject;

            tilemap = obj.GetComponent <Tilemap>();
            script  = obj.GetComponent <MapSelectScript>();

            Color rcolor = script.GetRedTileColor();
            Color bcolor = script.GetBlueTileColor();

            Constants.player_color = playerData.Instance.isHost ? rcolor : bcolor;
            Constants.enemy_color  = (Constants.player_color != rcolor) ? rcolor : bcolor;
            /*Debug.Log(Constants.enemy_color);*/
        }