示例#1
0
文件: Drag.cs 项目: migenius/rs-unity
        void Start()
        {
            GameObject rs = GameObject.Find("RealityServer");

            if (rs != null)
            {
                Viewport = rs.GetComponent <UnityViewport> ();
                if (Viewport == null)
                {
                    Logger.Log("error", "Object drag component needs a UnityViewport component to work with.");
                    this.enabled = false;
                    return;
                }
                if (Viewport.enabled == false)
                {
                    Logger.Log("error", "Object drag component needs a UnityViewport that is enabled to work with.");
                    this.enabled = false;
                    return;
                }
            }
            else
            {
                Logger.Log("error", "Object drag requires RealityServer");
                this.enabled = false;
                return;
            }

            Camera cam = Viewport.RenderCamera;

            if (cam != null)
            {
                NavigationScript = cam.GetComponent("CameraNavigation");
                if (NavigationScript == null)
                {
                    Logger.Log("error", "Object drag requires CameraNavigation");
                    this.enabled = false;
                    return;
                }
            }
            else
            {
                Logger.Log("error", "Object drag requires Main Camera");
                this.enabled = false;
                return;
            }


            Moved = false;

            Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);
        }
示例#2
0
 void Start()
 {
     if (Viewport == null)
     {
         Logger.Log("error", "Status component needs a UnityViewport to work with.");
         this.enabled = false;
         return;
     }
     if (Viewport.enabled == false)
     {
         Logger.Log("error", "Status component needs the UnityViewport to be enabled to work with it.");
         this.enabled = false;
         return;
     }
 }
示例#3
0
    void OnStatus(string type, string message)
    {
        Logger.Log("info", "Status - " + type + ": " + message);
        if (type == "render")
        {
            Hide = true;
            return;
        }

        Hide = false;
        if (type != "info")
        {
            Text = type.ToUpper() + ": " + message;
        }
        else
        {
            Text = message;
        }
    }
示例#4
0
        void Start()
        {
            Viewport = GetComponent <UnityViewport>();
            if (Viewport == null)
            {
                Logger.Log("error", "Ground shadows component needs a UnityViewport component to work with.");
                this.enabled = false;
                return;
            }
            if (Viewport.enabled == false)
            {
                Logger.Log("error", "Ground shadows component needs a UnityViewport that is enabled to work with.");
                this.enabled = false;
                return;
            }
            Enabled = true;
            Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);

            OldGroundHeight = GroundHeight + 1.0f;
            OldAutoCalculateGroundHeight = !AutoCalculateGroundHeight;
            OldSceneYUp = !Viewport.SceneYUp;
        }
示例#5
0
        void Start()
        {
            Viewport = GetComponent <UnityViewport>();
            if (Viewport == null)
            {
                Logger.Log("error", "Iray background colour component needs a UnityViewport component to work with.");
                this.enabled = false;
                return;
            }
            if (Viewport.enabled == false)
            {
                Logger.Log("error", "Iray background colour component needs a UnityViewport that is enabled to work with.");
                this.enabled = false;
                return;
            }
            Enabled = this.enabled;
            Viewport.OnAppIniting += new ApplicationInitialisingCallback(OnAppIniting);

            Color temp = Colour;

            temp.a    = temp.a > 0.0f ? 0.0f : 1.0f;
            OldColour = temp;
        }