private void CreateControllers() { Debug.Log("loading sprites..." + NYDISpriteManager.Instance); InstantiateController(prfSpriteController); InstantiateController(prfInputController); InstantiateController(prfBuildController); InstantiateController(prfJobController); //InstantiateController(prfTrashController); InstantiateController(prfSoundController); this.spriteController = FindObjectOfType <SpriteController>(); //FindSpriteController.Instance; this.spriteController.wcon = this; this.inputController = FindObjectOfType <InputController>(); //InputController.Instance; this.buildController = FindObjectOfType <BuildController>(); //.Instance; this.jobController = FindObjectOfType <JobController>(); //.Instance; //this.trashController = FindObjectOfType<TrashController>();//.Instance; this.soundController = FindObjectOfType <SoundController>(); //.Instance; }
public void Init() { //WorldController.Instance.cbRegisterReady(Init); Debug.Log("init " + this.name); initialised = true; wcon = WorldController.Instance; cam = Camera.main; tileSize = World.current.tileSize; HALF_tileSize = tileSize / 2; bCon = WorldController.Instance.buildController; bCon.inputCon = this; cam.transform.position = new Vector3(World.current.width / 2, World.current.height / 2, cam.transform.position.z); cursorPrefab = Instantiate(cursorPrefab, this.transform.position, Quaternion.identity); cursorPrefab.transform.SetParent(this.transform, true); cursorPrefab.SetActive(false); //cursorPrefab.GetComponent<SpriteRenderer>().sprite = NYDISpriteManager.Instance.GetSprite("other::cursor_slice_2"); uConsoleGO = WorldController.Instance.uConsoleObject; UConsoleObj = uConsoleGO.GetComponent <UConsole>(); //WorldController.Instance.uConsoleObject.SetActive(false); }