Пример #1
0
        /// <summary>
        /// Instantiate a new gameobject and automatically add it to the FPV Container of DisableOnly Type.
        /// </summary>
        /// <param name="original"></param>
        /// <param name="position"></param>
        /// <param name="rotation"></param>
        /// <returns></returns>
        public static GameObject InstantiateDisableOnlyFPO(Object original, Vector3 position, Quaternion rotation)
        {
            GameObject result = Object.Instantiate(original, position, rotation) as GameObject;

            FPV_Container.AddDisableOnlyFPO(result); //Add to container
            return(result);
        }
Пример #2
0
 /// <summary>
 /// On Pre Render.
 /// Called for objects that get their ShadowCasterMode changed.
 /// </summary>
 void OnPreRender()
 {
     FPV_Container.EnableFirstPersonViewer();
 }
Пример #3
0
 /// <summary>
 /// On Post Render.
 /// Revert everything back to normal.
 /// </summary>
 void OnPostRender()
 {
     FPV_Container.DisableFirstPersonViewer();
     FPV_Renderer_Base.isFPVCameraRendering = false;
 }
Пример #4
0
 /// <summary>
 /// Pre Cull Method.
 /// This is called for objects which need to be disabled before rendering.
 /// </summary>
 void OnPreCull()
 {
     FPV_Renderer_Base.isFPVCameraRendering = true;
     FPV_Container.EnableDisableOnlyFirstPersonViewer();
 }
 /// <summary>
 /// Remove this object from the DisableOnlyFPO container
 /// </summary>
 protected override void OnDestroy()
 {
     FPV_Container.RemoveDisableOnlyFPO(this);
 }
 /// <summary>
 /// Add this object to the DisableOnlyFPO container
 /// </summary>
 protected override void AddToContainer()
 {
     FPV_Container.AddDisableOnlyFPO(this);
 }
 /// <summary>
 /// Always remove the object if it is destroyed
 /// </summary>
 protected virtual void OnDestroy()
 {
     FPV_Container.RemoveGenericFPO(this);
 }
 /// <summary>
 /// Add this object to the container.
 /// </summary>
 protected virtual void AddToContainer()
 {
     FPV_Container.AddGenericFPO(this);
 }