Esempio n. 1
0
        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);
        }
Esempio n. 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;
     }
 }
Esempio n. 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;
        }
    }
Esempio n. 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;
        }
Esempio n. 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;
        }