/// <summary> /// Update info and data /// </summary> void OnEnable() { menu = (F3DPoolManager)target; databaseName = menu.databaseName; index = menu.selectedItem; haveToShow = menu.haveToShowArr; }
public static void OpenPoolManager() { F3DPoolManager manager = GameObject.FindObjectOfType <F3DPoolManager>(); if (manager != null) { Selection.activeGameObject = manager.gameObject; } else { GameObject newManager = new GameObject("PoolManager"); newManager.AddComponent <F3DPoolManager>(); Selection.activeGameObject = newManager; } }
/// <summary> // deterministic start. /// <summary> public void StartMain(int inputint) { started = true; i = inputint; startcount = 0; customran = TSRandom.New(transform.parent.GetComponent <PhotonView>().viewID + inputint); parentscript = transform.parent.GetComponent <_Ship>(); if (guntypemain == guntype.EngineUpgrade) { parentscript.MaxSpeed = parentscript.MaxSpeed * 1.15f; } if (guntypemain == guntype.HPUpgrade) { parentscript.Armor = Mathf.RoundToInt(parentscript.Armor * 1.15f); } if (guntypemain == guntype.WeaponUpgrade) { foreach (Transform gun in transform.parent) { if (gun.tag == "Pickup") { _Weapon gunwep = gun.GetComponent <_Weapon>(); gunwep.timebetweenshots = gunwep.timebetweenshots * 1.15; } } } if (guntypemain == guntype.Cloak) { parentscript.iscloacked = true; } if (guntypemain == guntype.Tracker) { parentscript.isTracker = true; } unittargetcontrol = GameObject.Find("Controllers").GetComponent <UnitMovementcommandcontroller>(); poolmanager = GameObject.Find("F3dPoolManager").GetComponent <F3DPoolManager>(); team = parentscript.ShipColor; if (verticalmovechild == null && transform.childCount > 0 && transform.GetChild(0).childCount > 0) { verticalmovechild = transform.GetChild(0).GetChild(0).gameObject; } _Ship parent = transform.parent.GetComponent <_Ship>(); if (Cannon_Projectile != null) { parent.Cannon_Projectile = Cannon_Projectile; } if (Missile_Projectile != null) { parent.Missile_Projectile = Missile_Projectile; } if (MiniGun_Projectile != null) { parent.MiniGun_Projectile = MiniGun_Projectile; } if (Lazer_Proectile != null) { parent.Lazer_Shot = Lazer_Proectile; } parent.shieldmaterial = shieldmatgam; damage = Calculate_damage(); audiosource = GetComponent <AudioSource>(); WorldBase = GameObject.Find("WorldScaleBase"); timepassed = 0; }