public static void Init(){ if(instance!=null) return; GameObject obj=new GameObject(); instance=obj.AddComponent<NodeGenerator>(); obj.name="NodeGenerator"; }
public void Awake() { if (instance != null) { return; } instance = this; thisT = transform; }
public static void Init() { if (instance != null) { return; } GameObject obj = new GameObject(); instance = obj.AddComponent <NodeGenerator>(); obj.name = "NodeGenerator"; }
public void GenerateNode(float heightOffset = 0) { nodeGraph = NodeGenerator.GenerateNode(this, 0); }
void Awake() { Time.fixedDeltaTime = timeStep; instance = this; thisT = transform; ObjectPoolManager.Init(); NodeGenerator nodeGenerator = (NodeGenerator)FindObjectOfType(typeof(NodeGenerator)); if (nodeGenerator != null) { nodeGenerator.Awake(); } PathFinder pathFinder = (PathFinder)FindObjectOfType(typeof(PathFinder)); if (pathFinder != null) { pathFinder.Awake(); } PathTD[] paths = FindObjectsOfType(typeof(PathTD)) as PathTD[]; if (paths.Length > 0) { for (int i = 0; i < paths.Length; i++) { paths[i].Init(); } } TDTK.InitDB(); ResourceManager rscManager = (ResourceManager)FindObjectOfType(typeof(ResourceManager)); if (rscManager != null) { rscManager.Init(); } PerkManager perkManager = (PerkManager)FindObjectOfType(typeof(PerkManager)); if (perkManager != null) { perkManager.Init(); } BuildManager buildManager = (BuildManager)FindObjectOfType(typeof(BuildManager)); if (buildManager != null) { buildManager.Init(); } AbilityManager abilityManager = (AbilityManager)FindObjectOfType(typeof(AbilityManager)); if (abilityManager != null) { abilityManager.Init(); } FPSControl fpsControl = (FPSControl)FindObjectOfType(typeof(FPSControl)); if (fpsControl != null) { fpsControl.Init(); } IndicatorControl indicatorControl = (IndicatorControl)FindObjectOfType(typeof(IndicatorControl)); if (indicatorControl != null) { indicatorControl.Init(); } //if(loadAudioManager){ // Instantiate(Resources.Load("AudioManager", typeof(GameObject))); //} Time.timeScale = 1; }
void Awake() { Time.fixedDeltaTime = timeStep; instance = this; thisT = transform; ObjectPoolManager.Init(); BuildManager buildManager = (BuildManager)FindObjectOfType(typeof(BuildManager)); if (buildManager != null) { buildManager.Init(); } NodeGenerator nodeGenerator = (NodeGenerator)FindObjectOfType(typeof(NodeGenerator)); if (nodeGenerator != null) { nodeGenerator.Awake(); } PathFinder pathFinder = (PathFinder)FindObjectOfType(typeof(PathFinder)); if (pathFinder != null) { pathFinder.Awake(); } PathTD[] paths = FindObjectsOfType(typeof(PathTD)) as PathTD[]; if (paths.Length > 0) { for (int i = 0; i < paths.Length; i++) { paths[i].Init(); } } if (buildManager != null) { for (int i = 0; i < buildManager.buildPlatforms.Count; i++) { buildManager.buildPlatforms[i].Init(); } } gameObject.GetComponent <ResourceManager>().Init(); PerkManager perkManager = (PerkManager)FindObjectOfType(typeof(PerkManager)); if (perkManager != null) { perkManager.Init(); } if (loadAudioManager) { Instantiate(Resources.Load("AudioManager", typeof(GameObject))); } if (rangeIndicator) { rangeIndicator = (Transform)Instantiate(rangeIndicator); rangeIndicator.parent = thisT; rangeIndicatorObj = rangeIndicator.gameObject; } if (rangeIndicatorCone) { rangeIndicatorCone = (Transform)Instantiate(rangeIndicatorCone); rangeIndicatorCone.parent = thisT; rangeIndicatorConeObj = rangeIndicatorCone.gameObject; } ClearSelectedTower(); Time.timeScale = 1; }
public void Awake(){ if(instance!=null) return; instance=this; thisT=transform; }
void Awake() { if(instance!=null) instance=this; thisT=transform; }