Ejemplo n.º 1
0
        public virtual void Initialize(GameObject go, FGOFlags flags)
        {
            this.go = go;

            bool bEnablePreRender = (flags & FGOFlags.EnablePreRender) != 0;

            if (bEnablePreRender)
            {
                if (go.GetComponent <PreRenderBehavior>() != null)
                {
                    throw new Exception("fGameObject.Initialize: tried to add PreRenderBehavior to this go, but already exists!");
                }
                PreRenderBehavior pb = go.AddComponent <PreRenderBehavior>();
                pb.ParentFGO = this;
            }
        }
Ejemplo n.º 2
0
        public virtual void Initialize(GameObject go, FGOFlags flags)
        {
            this.go = go;

            // Link the go to this fGameObject. Normally the fGameObjectRef would not already exist.
            // But it can in two cases:
            //   1) you created the input go by calling Instantiate() on an existing go which
            //      already had an fGameObjectRef. For example this happens at F3 startup with the Camera duplicates.
            //      In that case, it will not be initialized, so fgo is null
            //   2) you cast the input go to an fGameObject before you called this. In that case a default
            //      fGameObject instance was already created that we no longer want. You should not do this!
            //      (Eventually this will throw an Exception!!)
            if (go.GetComponent <fGameObjectRef>() == null)
            {
                go.AddComponent <fGameObjectRef>();
            }
            else
            {
                // [RMS] print error if duplicate FGO created for a GO. This is helpful.
                // However currently CurveRendererImplementation requires an FGO be created
                // *before* it can be passed to a fCurveGameObject =\
                //if (go.GetComponent<fGameObjectRef>().fgo != null)
                //    DebugUtil.Log("Duplicate fGameObject created for go " + go.name);
            }
            go.GetComponent <fGameObjectRef>().fgo = this;

            bool bEnablePreRender = (flags & FGOFlags.EnablePreRender) != 0;

            if (bEnablePreRender)
            {
                if (go.GetComponent <PreRenderBehavior>() != null)
                {
                    throw new Exception("fGameObject.Initialize: tried to add PreRenderBehavior to this go, but already exists!");
                }
                PreRenderBehavior pb = go.AddComponent <PreRenderBehavior>();
                pb.ParentFGO = this;
            }
        }
Ejemplo n.º 3
0
 public virtual void Initialize(GameObject go, fGraph graph, FGOFlags flags)
 {
     base.Initialize(go, flags);
     Graph = graph;
 }
Ejemplo n.º 4
0
 public fGraphGameObject(GameObject go, fGraph graph, FGOFlags flags)
     : base(go, flags)
 {
     Graph = graph;
 }
Ejemplo n.º 5
0
 public virtual void Initialize(GameObject go, fMesh mesh, FGOFlags flags)
 {
     base.Initialize(go, flags);
     Mesh = mesh;
 }
Ejemplo n.º 6
0
 public fMeshGameObject(GameObject go, fMesh mesh, FGOFlags flags)
     : base(go, flags)
 {
     Mesh = mesh;
 }
Ejemplo n.º 7
0
 public fGameObject(GameObject go, FGOFlags flags = FGOFlags.NoFlags)
 {
     Initialize(go, flags);
 }