Пример #1
0
 public override void Disconnect(bool bDestroy)
 {
     sceneParentGO.SetParent(null);
     base.Disconnect(bDestroy);
     if (bDestroy)
     {
         sceneParentGO.Destroy();
     }
 }
Пример #2
0
 public void Start()
 {
     fadeObject = new fGameObject(GameObject.CreatePrimitive(PrimitiveType.Sphere), FGOFlags.NoFlags);
     //fadeObject.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
     fadeObject.SetMaterial(MaterialUtil.CreateFlatMaterial(Color.black, 0.0f), true);
     fadeObject.SetName("fade_sphere");
     UnityUtil.ReverseMeshOrientation(fadeObject.GetMesh());
     fadeObject.SetParent(UseCamera.GameObject(), false);
     fadeObject.SetLayer(FPlatform.HUDLayer);
 }
Пример #3
0
 public virtual void AppendNewGO(fGameObject go, fGameObject parent, bool bKeepPosition)
 {
     vObjects.Add(go);
     go.SetParent(parent, bKeepPosition);
     go.SetLayer(parent.GetLayer());
     foreach (GameObject child_go in go.Children())
     {
         vObjects.Add(child_go);
         child_go.SetLayer(parent.GetLayer());
     }
 }
Пример #4
0
 public void RemoveWorldBoundsObject(fGameObject obj)
 {
     obj.SetParent(null, true);
     vBoundsObjects.Remove(obj);
 }
Пример #5
0
 public void AddWorldBoundsObject(fGameObject obj)
 {
     vBoundsObjects.Add(obj);
     obj.SetParent(bounds_objects, false);
 }
Пример #6
0
        public void Reset(bool bKeepBoundsObjects = true, bool bKeepLighting = true)
        {
            ClearHistory();

            ClearSelection();
            RemoveAllSceneObjects();
            foreach (var so in vDeleted)
            {
                so.Disconnect(true);
                so.RootGameObject.Destroy();
            }
            vDeleted.Clear();

            RemoveAllUIElements();

            LinkManager.RemoveAllLinks();

            SetCurrentTime(0);
            SelectionMask = null;

            // save bounds objects
            var         save_bounds = vBoundsObjects;
            fGameObject boundsGO    = null;

            if (bKeepBoundsObjects)
            {
                boundsGO = bounds_objects;
                boundsGO.SetParent(null, true);
            }

            // save lighting objects
            fGameObject lightingGO = null;

            if (bKeepLighting)
            {
                lightingGO = lighting_objects;
                lightingGO.SetParent(null, true);
            }

            // save camera
            CameraState camera_state = ActiveCamera.Manipulator().GetCurrentState(this);

            // make sure we get rid of any cruft
            sceneRoot.Destroy();

            // rebuild scene
            initialize_scene_root();

            // restore camera
            ActiveCamera.Manipulator().SetCurrentSceneState(this, camera_state);

            // restore bounds objects
            if (bKeepBoundsObjects)
            {
                bounds_objects.Destroy();
                boundsGO.SetParent(sceneRoot, true);
                bounds_objects = boundsGO;
                vBoundsObjects = save_bounds;
            }

            // restore lighting objects
            if (bKeepLighting)
            {
                lighting_objects.Destroy();
                lightingGO.SetParent(sceneRoot, true);
                lighting_objects = lightingGO;
            }
        }
Пример #7
0
 public static void DestroyGO(fGameObject go)
 {
     go.SetParent(null);
     UnityEngine.GameObject.Destroy(go);
 }
Пример #8
0
 public static void DestroyGO(fGameObject go)
 {
     go.SetParent(null);
     go.Destroy();
 }
Пример #9
0
 public virtual void RemoveGO(fGameObject go)
 {
     vObjects.Remove(go);
     go.SetParent(null, true);
 }