ToString() public method

public ToString ( ) : string
return string
コード例 #1
0
ファイル: Vector3.cs プロジェクト: liuruoyu1981/CQuark
        public static bool UnityEngineVector3MCall(object objSelf, string functionName, List <CQ_Value> param, out CQ_Value returnValue, bool mustEqual)
        {
            UnityEngine.Vector3 obj = (UnityEngine.Vector3)objSelf;
            if (param.Count == 3 && functionName == "Set" && MatchType(param, new Type[] { typeof(float), typeof(float), typeof(float) }, mustEqual))
            {
                returnValue = null;
                obj.Set((float)param[0].ConvertTo(typeof(float)), (float)param[1].ConvertTo(typeof(float)), (float)param[2].ConvertTo(typeof(float)));
                return(true);
            }
            if (param.Count == 1 && functionName == "Scale" && MatchType(param, new Type[] { typeof(UnityEngine.Vector3) }, mustEqual))
            {
                returnValue = null;
                obj.Scale((UnityEngine.Vector3)param[0].ConvertTo(typeof(UnityEngine.Vector3)));
                return(true);
            }
            if (param.Count == 0 && functionName == "GetHashCode")
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(int);
                returnValue.value = obj.GetHashCode();
                return(true);
            }
            if (param.Count == 1 && functionName == "Equals" && MatchType(param, new Type[] { typeof(object) }, mustEqual))
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(bool);
                returnValue.value = obj.Equals((object)param[0].ConvertTo(typeof(object)));
                return(true);
            }
            if (param.Count == 0 && functionName == "Normalize")
            {
                returnValue = null;
                obj.Normalize();
                return(true);
            }
            if (param.Count == 0 && functionName == "ToString")
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(string);
                returnValue.value = obj.ToString();
                return(true);
            }
            if (param.Count == 1 && functionName == "ToString" && MatchType(param, new Type[] { typeof(string) }, mustEqual))
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(string);
                returnValue.value = obj.ToString((string)param[0].ConvertTo(typeof(string)));
                return(true);
            }
            if (param.Count == 0 && functionName == "GetType")
            {
                returnValue       = new CQ_Value();
                returnValue.type  = typeof(System.Type);
                returnValue.value = obj.GetType();
                return(true);
            }

            returnValue = null;
            return(false);
        }
コード例 #2
0
    static int ToString(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Vector3)))
            {
                UnityEngine.Vector3 obj = (UnityEngine.Vector3)ToLua.ToObject(L, 1);
                string o = obj.ToString();
                LuaDLL.lua_pushstring(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Vector3), typeof(string)))
            {
                UnityEngine.Vector3 obj = (UnityEngine.Vector3)ToLua.ToObject(L, 1);
                string arg0             = ToLua.ToString(L, 2);
                string o = obj.ToString(arg0);
                LuaDLL.lua_pushstring(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Vector3.ToString"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #3
0
ファイル: CubeLoader.cs プロジェクト: jeedee/ZapLoader
        void IChunkLoader.LoadChunk(Vector3 position)
        {
            GameObject chunk = GameObject.CreatePrimitive(PrimitiveType.Cube);
            chunk.transform.localScale = new Vector3(ZapLoader.instance.chunkSize, ZapLoader.instance.chunkSize, ZapLoader.instance.chunkSize);
            chunk.transform.position = position;
            chunk.name = position.ToString();

            cubes.Add(position, chunk);
        }
コード例 #4
0
    public void UnityToIRescue()
    {
        Vector3 xyzd   = new Vector3(90, -45, -45);
        Vector3 zxyd   = new Vector3(45, -90, -45);
        Vector3 actual = EulerAnglesConversion.ZXYtoXYZ(zxyd);

        Assert.AreEqual(xyzd.ToString(), actual.ToString());

        xyzd   = new Vector3(90, 90, -90);
        zxyd   = new Vector3(0, -90, 180);
        actual = EulerAnglesConversion.ZXYtoXYZ(zxyd);

        Assert.AreEqual(xyzd.ToString(), actual.ToString());

        xyzd   = new Vector3(0, 0, 0);
        zxyd   = new Vector3(0, 0, 0);
        actual = EulerAnglesConversion.ZXYtoXYZ(zxyd);
        Assert.AreEqual(xyzd.ToString(), actual.ToString());
    }
コード例 #5
0
        private void ValidateValues()
        {
            UnityEngine.Vector3 normalVector = new UnityEngine.Vector3((float)normal.x, (float)normal.y, (float)normal.z);

            if (normalVector.magnitude > 1)
            {
                print("Invalid vertex, weird normal: " + normalVector.ToString());
            }

            if (System.Math.Abs(uv.x) > 1f || System.Math.Abs(uv.y) > 1f)
            {
                print("Invalid vertex, weird UV: (" + uv.x + "," + uv.y + ")");
            }
        }
コード例 #6
0
 void DoEverything()
 {
     OnInitializePhysics();
     for (int i = 0; i < 100; i++)
     {
         OnUpdate();
         for (int j = 0; j < numLinks; j++)
         {
             MultiBodyLinkCollider linkCollider = links[j];
             UnityEngine.Matrix4x4 m            = linkCollider.WorldTransform.ToUnity();
             UnityEngine.Vector3   p            = BSExtensionMethods2.ExtractTranslationFromMatrix(ref m);
             linkPositions[j] = p;
             UnityEngine.Debug.Log("pos " + p.ToString("f3") + " " + j);
         }
     }
     ExitPhysics();
 }
コード例 #7
0
    IEnumerator myCoroutine()
    {
        Debug.Log("Waiting to start");
        while (!Input.GetKeyDown(KeyCode.Space))
        {
            yield return(null);
        }
        OnInitializePhysics();

        Debug.Log("Initialized");
        int frame = 0;

        while (frame < 10)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                frame++;
                Debug.Log("Do Update " + frame);
                for (int j = 0; j < numLinks; j++)
                {
                    MultiBodyLinkCollider linkCollider = links[j];
                    for (int k = 0; k < 5; k++)
                    {
                        OnUpdate();
                    }
                    UnityEngine.Matrix4x4 m = linkCollider.WorldTransform.ToUnity();
                    UnityEngine.Vector3   p = BSExtensionMethods2.ExtractTranslationFromMatrix(ref m);
                    linkPositions[j] = p;
                    UnityEngine.Debug.Log("pos " + p.ToString("f3") + " " + j);
                }
            }
            yield return(null);
        }
        Debug.Log("Finalize");
        ExitPhysics();
    }
コード例 #8
0
ファイル: Fleet.cs プロジェクト: DanishKizilbash/Cosmos4X
		public void FleetMoveTo (Vector3 Pos)
		{
			string posString = Pos.ToString ();
			foreach (ActorShip actor in ships) {
				actor.brain.EndCurrentTasks ();
				actor.brain.AddCommand ("UserMoveTo|" + posString);				
			}
		}
コード例 #9
0
        // Gets the Tile associated with the given key
        public static Tile GetTile(Vector3 key)
        {
            // Just as a caution in case the caller doesn't check for the key's existence first
            // Or if it's easier to just call this; We'll check for the keys existence first
            if (!EntryExists(key))
            {
                // The key doesn't exist so return null
                Debug.LogErrorFormat("Key at {0} doesn't exist!", key.ToString("F2"));
                return null;
            } // end if

            // Otherwise the key exists so return the value according to the key
            return tiles[key];
        }
コード例 #10
0
ファイル: DelegatesExample.cs プロジェクト: srndpty/VFW
 public string Func2Method(GameObject arg0, Vector3 arg1)
 {
     LogFormat("Func0Method {0}, {1}", arg0, arg1);
     return arg1.ToString();
 }
コード例 #11
0
    static bool Vector3_ToString(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.Vector3 argThis = (UnityEngine.Vector3)vc.csObj;                JSApi.setStringS((int)JSApi.SetType.Rval, argThis.ToString());
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
コード例 #12
0
    static bool Vector3_ToString__String(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            System.String       arg0    = (System.String)JSApi.getStringS((int)JSApi.GetType.Arg);
            UnityEngine.Vector3 argThis = (UnityEngine.Vector3)vc.csObj;                JSApi.setStringS((int)JSApi.SetType.Rval, argThis.ToString(arg0));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
コード例 #13
0
ファイル: WorldState.cs プロジェクト: jsjxsy/wushi
 public override string ToString()
 {
     return(Vector.ToString());
 }
コード例 #14
0
ファイル: TestHelper.cs プロジェクト: pheney/PLibUnitTests
 public static string ShowVariables(UnityEngine.Vector3 expected, UnityEngine.Vector3 actual)
 {
     return(expected.ToString() + " == " + actual.ToString());
 }
コード例 #15
0
 public void Set(Vector3 vector) {
   Text.text = vector.ToString();
 }
コード例 #16
0
ファイル: HooksTest.cs プロジェクト: romgerman/Oxide
 private void OnAirDrop(Vector3 dropLocation)
 {
     HookCalled("OnAirDrop");
     // Print airdrop location
     Puts("An airdrop is being called at location " + dropLocation.ToString());
 }
コード例 #17
0
 public override string ToString()
 {
     return(vector3.ToString());
 }
コード例 #18
0
    public void OnInputClicked(InputClickedEventData eventData)
    {
        if (eventData.PressType == InteractionSourcePressInfo.Select && isRobotPointCloudGameObjectActive)
        {
            if (eventData.selectedObject != null)
            {
                if (eventData.selectedObject.layer == 31)
                {
                    Vector3 targetPosition = cursor.transform.position;

                    robotTargetFlag.transform.position = targetPosition;
                    robotTargetFlag.SetActive(true);

                    TimeSpan currentTime = Timer.SampleCurrentStopwatch();
#if NETFX_CORE
                    ThreadPool.RunAsync((PoseSendWork) => { SendRobotTargetPose(currentTime.Add(Timer.GetOffsetUTC()), Quaternion.identity, targetPosition); });
#endif

                    System.Diagnostics.Debug.WriteLine("Air tapped robot target position: " + targetPosition.ToString());
                }
            }
            else
            {
                string userMessage = "You air tapped on an unknown space. Try again!";
                userMessageManager.ShowUserMessage(userMessage, 2f);
                System.Diagnostics.Debug.WriteLine("You air tapped on an unknown space. Try again!");
            }
        }
    }
コード例 #19
0
 // Returns a nicely formatted string for the bounds.
 public string ToString(string format)
 {
     return(UnityString.Format("Center: {0}, Extents: {1}", m_Center.ToString(format), m_Extents.ToString(format)));
 }