예제 #1
0
 private void OnEnable()
 {
     Easyflow.RegisterCamera(this);
     if (this.Instance == null)
     {
         this.Instance = Easyflow.CurrentInstance;
     }
     if (this.Reference == null)
     {
         this.Reference = Easyflow.CurrentReference;
     }
     this.m_material           = new Material(Shader.Find("Hidden/Easyflow/BackgroundVectors"));
     this.m_material.hideFlags = HideFlags.DontSave;
     int[] numArray = new int[] {
         0, 1, 2, 2, 1, 3, 4, 0, 6, 6, 0, 2, 7, 5, 6, 6,
         5, 4, 3, 1, 7, 7, 1, 5, 4, 5, 0, 0, 5, 1, 3, 7,
         2, 2, 7, 6
     };
     Vector3[] vectorArray = new Vector3[] { new Vector3(-1f, 1f, -1f), new Vector3(1f, 1f, -1f), new Vector3(-1f, -1f, -1f), new Vector3(1f, -1f, -1f), new Vector3(-1f, 1f, 1f), new Vector3(1f, 1f, 1f), new Vector3(-1f, -1f, 1f), new Vector3(1f, -1f, 1f) };
     this.m_cube           = new Mesh();
     this.m_cube.vertices  = vectorArray;
     this.m_cube.triangles = numArray;
     this.UpdateProperties();
     this.m_step = false;
 }
예제 #2
0
파일: Easyflow.cs 프로젝트: lovigame/alalei
    private void UpdatePostProcess()
    {
        Camera camera   = null;
        float  minValue = float.MinValue;

        foreach (Camera camera2 in this.m_linkedCameras.Keys)
        {
            if (camera2.depth > minValue)
            {
                camera   = camera2;
                minValue = camera2.depth;
            }
        }
        if ((this.m_currentPostProcess != null) && (this.m_currentPostProcess.gameObject != camera.gameObject))
        {
            UnityEngine.Object.Destroy(this.m_currentPostProcess);
            this.m_currentPostProcess = null;
        }
        if ((this.m_currentPostProcess == null) && (camera != null))
        {
            CurrentInstance           = this;
            this.m_currentPostProcess = camera.gameObject.AddComponent <EasyflowPostProcess>();
            CurrentInstance           = null;
        }
    }
예제 #3
0
 private void OnEnable()
 {
     if (this.Instance == null)
     {
         this.Instance = Easyflow.CurrentInstance;
     }
 }
예제 #4
0
파일: Easyflow.cs 프로젝트: lovigame/alalei
 private void Awake()
 {
     if (m_firstInstance == null)
     {
         m_firstInstance = this;
     }
     this.m_globalObjectId = 1;
     this.m_width          = 0;
     this.m_height         = 0;
     this.m_rcpWidth       = this.m_rcpHeight = 0f;
 }
예제 #5
0
 private void OnEnable()
 {
     if (base.renderer.GetType() == typeof(MeshRenderer))
     {
         this.m_type = EasyflowObjectType.Solid;
     }
     else if (base.renderer.GetType() == typeof(SkinnedMeshRenderer))
     {
         this.m_type = EasyflowObjectType.Skinned;
     }
     else if (base.renderer.GetType() == typeof(ClothRenderer))
     {
         this.m_type = EasyflowObjectType.Cloth;
     }
     Easyflow.RegisterObject(this);
 }
예제 #6
0
파일: Easyflow.cs 프로젝트: lovigame/alalei
    private EasyflowCamera AddMotionCamera(Camera reference)
    {
        CurrentInstance  = this;
        CurrentReference = reference;
        string         auxCameraName = "Easyflow+" + reference.name;
        GameObject     obj2          = this.RecursiveFindCamera(base.gameObject, auxCameraName);
        EasyflowCamera component     = null;

        if (obj2 == null)
        {
            obj2 = new GameObject {
                name      = auxCameraName,
                hideFlags = HideFlags.HideAndDontSave
            };
        }
        else
        {
            component = obj2.GetComponent <EasyflowCamera>();
        }
        if (component == null)
        {
            component = obj2.AddComponent <EasyflowCamera>();
            component.camera.CopyFrom(reference);
            component.camera.depth            = reference.depth - 1f;
            component.camera.renderingPath    = RenderingPath.VertexLit;
            component.camera.hdr              = false;
            component.camera.cullingMask      = reference.cullingMask;
            component.camera.depthTextureMode = DepthTextureMode.Depth;
            component.camera.enabled          = true;
            component.camera.clearFlags       = CameraClearFlags.Depth;
            component.camera.SetReplacementShader(this.m_motionMaterial.shader, "RenderType");
        }
        CurrentReference = null;
        CurrentInstance  = null;
        return(component);
    }
예제 #7
0
 private void OnDisable()
 {
     Easyflow.UnregisterCamera(this);
 }
예제 #8
0
 private void OnDisable()
 {
     Easyflow.UnregisterObject(this);
 }