Ejemplo n.º 1
0
 void SetLocationFields(Dictionary <string, string> parameters)
 {
     Stellarium.POST(Path, "setlocationfields", parameters, (result, error) => {
         if (error != null)
         {
             Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
         }
         if (OnSetLocationFields != null)
         {
             OnSetLocationFields();
         }
     });
 }
Ejemplo n.º 2
0
        public void Stop()
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            Stellarium.POST(Path, "stop", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnStoppedScript != null)
                {
                    OnStoppedScript();
                }
            });
        }
Ejemplo n.º 3
0
        public void SetFOV(float fov)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("fov", fov.ToString());
            Stellarium.POST(Path, "fov", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnSetFOV != null)
                {
                    OnSetFOV();
                }
            });
        }
Ejemplo n.º 4
0
        public void Run(string id)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("id", id);
            Stellarium.POST(Path, "run", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnStartedScript != null)
                {
                    OnStartedScript();
                }
            });
        }
Ejemplo n.º 5
0
        public void SetMove(float x, float y)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("x", x.ToString());
            parameters.Add("y", y.ToString());
            Stellarium.POST(Path, "move", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnSetMove != null)
                {
                    OnSetMove();
                }
            });
        }
Ejemplo n.º 6
0
        public void SetTime(double time, double timerate)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("time", time.ToString());
            parameters.Add("timerate", timerate.ToString());
            Stellarium.POST(Path, "time", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnSetTime != null)
                {
                    OnSetTime();
                }
            });
        }
Ejemplo n.º 7
0
        public void Set(string id, string value)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("id", id);
            parameters.Add("value", value);
            Stellarium.POST(Path, "set", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnSetProperty != null)
                {
                    OnSetProperty();
                }
            });
        }
Ejemplo n.º 8
0
        public void Do(string id)   //TODO: Find out what constitutes a valid parameter
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("id", id);
            Stellarium.POST(Path, "do", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                bool b = false;
                if (!bool.TryParse(result, out b))
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, result)); return;
                }
                if (OnDidAction != null)
                {
                    OnDidAction(b);
                }
            });
        }
Ejemplo n.º 9
0
        public void DirectRun(string code, bool useIncludes = default(bool))
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("code", code);
            if (useIncludes != default(bool))
            {
                parameters.Add("useIncludes", useIncludes.ToString());
            }
            parameters.Add("useIncludes", useIncludes.ToString());
            Stellarium.POST(Path, "direct", parameters, (result, error) => {
                if (error != null)
                {
                    Debug.LogError(string.Format("[{0}] {1}", Identifier, error)); return;
                }
                if (OnRanCode != null)
                {
                    OnRanCode();
                }
            });
        }