static void _ConvertBoxCollider2Dto3D(GameObject o) { o.layer = GK.LayerId("UI"); var rb = o.GetComponent <Rigidbody>(); if (rb) { GK.Destroy(rb); } var co = o.GetComponent <BoxCollider2D>(); if (co) { Vector4 v4 = new Vector4(co.size.x, co.size.y, co.offset.x, co.offset.y); GK.Destroy(co); o.AddComponent <BoxCollider>(); o.GetComponent <BoxCollider>().size = new Vector3(v4.x, v4.y, 1); o.GetComponent <BoxCollider>().center = new Vector3(v4.z, v4.w, 1); } foreach (Transform t in o.transform) { _ConvertBoxCollider2Dto3D(t.gameObject); } }
static public void ClosePanel <T>(T panel) where T : MonoBehaviour { if (panel != null) { GK.Destroy(panel.gameObject); } }
public void Save() { if (sceneObj) { GKEditor.CreateOrReplacePrefab(path, sceneObj); AssetDatabase.SaveAssets(); GK.Destroy(sceneObj); sceneObj = null; } }
public override void Execute(Map.World world) { Logger.Debug(" Death Of King Event Path 2"); //Берём участников сцены var LeoricGhost = world.GetActorBySNO(5365); var GhostKnights = world.GetActorsBySNO(4182); var LachdananGhost = world.GetActorBySNO(4183); var SwordPlace = world.GetActorBySNO(163449); TickTimer Timeout = new SecondsTickTimer(world.Game, 23f); var ListenerKingSkeletons = System.Threading.Tasks.Task <bool> .Factory.StartNew(() => WaitToSpawn(Timeout)); ListenerKingSkeletons.ContinueWith(delegate { LeoricGhost.Destroy(); LachdananGhost.Destroy(); foreach (var GK in GhostKnights) { GK.Destroy(); } }); }