public static bool LoadResources() { if (resource_loaded) { return(resource_loaded); } resource_loaded = true; s_material = ResourcesLoader.LoadResources <Material>("Materials/ground_mat"); s_grid = ResourcesLoader.LoadResources <Material>("Materials/grid_mat"); s_stone = ResourcesLoader.LoadResources <GameObject>("Prefabs/Stone").transform; s_breakable = ResourcesLoader.LoadResources <GameObject>("Prefabs/Breakable").transform; return(resource_loaded); }
void Start() { Application.runInBackground = true; s_instance = this; player_pool = new PoolSystem <GameObject>(ResourcesLoader.LoadResources <GameObject>("Prefabs/Player_model"), 4); bomb_pool = new PoolSystem <GameObject>(ResourcesLoader.LoadResources <GameObject>("Prefabs/Bomb"), 100); pwr_up_pool = new PoolSystem <GameObject>(ResourcesLoader.LoadResources <GameObject>("Prefabs/PowerUp"), 100); hud = GameObject.Find("HUD").GetComponent <HUD>(); m_MainCamera = GameObject.Find("MainCamera"); mainMenu = GameObject.Find("OrthoCamera").GetComponent <MainMenuScript>(); mp = GameObject.Find("MusicPlayer").GetComponent <MusicPlayer>(); endmenu = GameObject.Find("EndMenu").GetComponent <EndMenu>(); baseRotation = m_MainCamera.transform.rotation; gravityStates = new Vector3[] { Vector3.up *const_gravity, Vector3.forward *const_gravity, Vector3.forward * -const_gravity, Vector3.right *const_gravity, Vector3.right * -const_gravity }; }
void Start() { Instance = this; Physics.gravity = Vector3.down * Config.CONST_GRAVITY * Config.CONST_FACTOR; Application.runInBackground = true; if (server) { Network.InitializeSecurity(); Network.InitializeServer(4, listenPort, true); current_map = Maps.LoadMapsFromFile(map_path); } else { Debug.Log("Trying to log to " + remoteIP); Network.Connect(remoteIP, listenPort); } announcer = GameObject.Find("Announcer"); bomb = ResourcesLoader.LoadResources <GameObject>("Prefabs/Bomb"); timer_worldchange = 30; }