Пример #1
0
    internal void RegisterCamera(AmplifyMotionCamera camera)
    {
        Camera component = camera.GetComponent <Camera>();

        if ((component.cullingMask & 1 << base.gameObject.layer) != 0 && !this.m_states.ContainsKey(component))
        {
            MotionState value;
            switch (this.m_type)
            {
            case ObjectType.Solid:
                value = new SolidState(camera, this);
                break;

            case ObjectType.Skinned:
                value = new SkinnedState(camera, this);
                break;

            case ObjectType.Cloth:
                value = new ClothState(camera, this);
                break;

            default:
                throw new Exception("[AmplifyMotion] Invalid object type.");
            }
            camera.RegisterObject(this);
            this.m_states.Add(component, value);
        }
    }
Пример #2
0
    internal void RegisterCamera(EasyflowCamera camera)
    {
        if (((camera.camera.cullingMask & (((int)1) << base.gameObject.layer)) != 0) && !this.m_states.ContainsKey(camera.camera))
        {
            MotionState state = null;
            switch (this.m_type)
            {
            case EasyflowObjectType.Solid:
                state = new SolidState(camera, this);
                break;

            case EasyflowObjectType.Skinned:
                state = new SkinnedState(camera, this);
                break;

            case EasyflowObjectType.Cloth:
                state = new ClothState(camera, this);
                break;

            default:
                throw new Exception("[Easyflow] Invalid object type.");
            }
            camera.OnUpdateTransform += new EasyflowCamera.OnUpdateTransformDelegate(this.OnUpdateTransform);
            if (this.m_type == EasyflowObjectType.Cloth)
            {
                camera.OnCameraPostRender += new EasyflowCamera.OnCameraPostRenderDelegate(this.OnCameraPostRender);
            }
            this.m_states.Add(camera.camera, state);
            this.m_debugStates.Add(state);
        }
    }