Example #1
0
 public void onStart()
 {
     player                 = transform.gameObject.GetComponent <Player>();
     guiDisplayer           = transform.gameObject.GetComponent <UnitManager>().getGuiDisplayer();
     woodWallManagerSpawned = spawnWoodWallManager(Vector2.zero);
     unitManager            = player.getUnitManager();
 }
Example #2
0
 public void onStart()
 {
     guiDisplayer      = canvas.GetComponent <GUIDisplayer>();
     player            = GetComponent <Player>();
     mapGrid           = player.getMapGrid();
     pathFinderManager = player.getSpawner().getPathFinderManager();
 }
Example #3
0
 void Awake()
 {
     buildingManager  = transform.gameObject.GetComponent <BuildingManager>();
     spawner          = transform.gameObject.GetComponent <Spawner>();
     unitManager      = transform.gameObject.GetComponent <UnitManager>();
     guiDisplayer     = GameObject.FindGameObjectWithTag("GUI").GetComponent <GUIDisplayer>();
     ressourceManager = GetComponent <RessourceManager>();
     spawner.onStart();
     woodWallManager = spawner.getWoodWallManager();
     enemyManager    = GetComponent <EnemyManager>();
     mapGrid.setPlayer(this);
     mapGrid.setGrid();
     unitManager.onStart();
 }
Example #4
0
    public void GetData()
    {
        GUIDisplayer.ShowDebug("Calling GetData()");
        Debug.Log("Calling GetData()");
        text.text = text.text + "\nCalling GetData()";
                #if UNITY_ANDROID
        using (AndroidJavaClass activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
            activityContext = activityClass.GetStatic <AndroidJavaObject>("currentActivity");
        }

        using (pluginClass = new AndroidJavaClass("com.bugdev.asus.app_2.MainActivity")) {
            if (pluginClass != null)
            {
                javaObj = pluginClass.CallStatic <AndroidJavaObject>("instance");
                javaObj.Call("setContext", activityContext);

                string data = javaObj.Call <string>("GetData");
                Debug.Log("Data : " + data);
                GUIDisplayer.ShowDebug("Data : " + data);
                text.text = text.text + "\nData : " + data;
            }
        }
                #endif
    }