place() 공개 메소드

public place ( Transform transform, float ratio ) : void
transform Transform
ratio float
리턴 void
예제 #1
0
    static int place(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3)
            {
                LTBezierPath          obj  = (LTBezierPath)ToLua.CheckObject <LTBezierPath>(L, 1);
                UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 2);
                float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                obj.place(arg0, arg1);
                return(0);
            }
            else if (count == 4)
            {
                LTBezierPath          obj  = (LTBezierPath)ToLua.CheckObject <LTBezierPath>(L, 1);
                UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 2);
                float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                UnityEngine.Vector3 arg2 = ToLua.ToVector3(L, 4);
                obj.place(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: LTBezierPath.place"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #2
0
 static public int place(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 3)
         {
             LTBezierPath          self = (LTBezierPath)checkSelf(l);
             UnityEngine.Transform a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             self.place(a1, a2);
             return(0);
         }
         else if (argc == 4)
         {
             LTBezierPath          self = (LTBezierPath)checkSelf(l);
             UnityEngine.Transform a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             UnityEngine.Vector3 a3;
             checkType(l, 4, out a3);
             self.place(a1, a2, a3);
             return(0);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
예제 #3
0
	static int place(IntPtr L)
	{
		try
		{
			int count = LuaDLL.lua_gettop(L);

			if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(LTBezierPath), typeof(UnityEngine.Transform), typeof(float)))
			{
				LTBezierPath obj = (LTBezierPath)ToLua.ToObject(L, 1);
				UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.ToObject(L, 2);
				float arg1 = (float)LuaDLL.lua_tonumber(L, 3);
				obj.place(arg0, arg1);
				return 0;
			}
			else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(LTBezierPath), typeof(UnityEngine.Transform), typeof(float), typeof(UnityEngine.Vector3)))
			{
				LTBezierPath obj = (LTBezierPath)ToLua.ToObject(L, 1);
				UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.ToObject(L, 2);
				float arg1 = (float)LuaDLL.lua_tonumber(L, 3);
				UnityEngine.Vector3 arg2 = ToLua.ToVector3(L, 4);
				obj.place(arg0, arg1, arg2);
				return 0;
			}
			else
			{
				return LuaDLL.luaL_throw(L, "invalid arguments to method: LTBezierPath.place");
			}
		}
		catch(Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
	// Use this for initialization
	void Start () 
	{
		Nuts = new Transform[numNuts];

		// Get the leantween editor path
		path = GetComponent<LeanTweenPath>();

		// Create a bezier path based on the path
		nutPath = new LTBezierPath(path.vec3);

		// Load up the prefab
		itemPrefab = Resources.Load("CrystalNutPrefab", typeof(GameObject)) as GameObject;

		// Fill up the array with nuts
		for (int i=0; i< Nuts.Length; i++)
			Nuts[i] = (Transform) Instantiate(itemPrefab).transform;

		float pct = 0.0f;
		//float portion = 1.0f/Nuts.Length + 0.1f;
		float portion = 1.0f / Nuts.Length;
		//print("portion:" + portion);
		for (int i = 0; i < Nuts.Length; i++)
		{
			//float pct = 0.1f * i * (10 / Nuts.Length);
			//print(pct);
			nutPath.place(Nuts[i], pct);
			pct += portion;

		}
	}
예제 #5
0
 void Update()
 {
     ltBezierPath.place(transform, iter);
     iter += Time.deltaTime * 0.03f;
     if (iter > 1.0f)
     {
         iter = 0.0f;
     }
 }
예제 #6
0
 static public int place(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 3)
         {
             LTBezierPath          self = (LTBezierPath)checkSelf(l);
             UnityEngine.Transform a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             self.place(a1, a2);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 4)
         {
             LTBezierPath          self = (LTBezierPath)checkSelf(l);
             UnityEngine.Transform a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             UnityEngine.Vector3 a3;
             checkType(l, 4, out a3);
             self.place(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function place to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
예제 #7
0
    void Update()
    {
        IncrementProgress();

        if (progressAvatar_1 > 1.0f || progressAvatar_2 > 1.0f || progressAvatar_3 > 1.0f)
        {
            ResetAvatarProgress();
            //OnRaceFinished();
        }



        path.place(avatar1.transform, progressAvatar_1);
        path.place(avatar2.transform, progressAvatar_2);
        path.place(avatar3.transform, progressAvatar_3);

        avatar1.transform.rotation = (Quaternion.identity);
        avatar2.transform.rotation = (Quaternion.identity);
        avatar3.transform.rotation = (Quaternion.identity);
    }
예제 #8
0
        void Update()
        {
            //Or Update Manually

            //cr.place2d(sprite1.transform, iter);

            iter += Time.deltaTime * 0.07f;
            if (iter > 1.0f)
            {
                iter = 0.0f;
            }

            cr.place(avatar1.transform, iter);
        }
예제 #9
0
    // Update is called once per frame
    void Update()
    {
        ltPath1.place(lt1.transform, iter1);
        lt2.transform.position = ltPath2.point(iter2);

        iter1 += Time.deltaTime * 0.1f;
        if (iter1 > 1.0f)
        {
            iter1 = 0.0f;
        }
        iter2 += Time.deltaTime * 0.1f;
        if (iter2 > 1.0f)
        {
            iter2 = 0.0f;
        }
    }
예제 #10
0
    // Update is called once per frame
    void Update()
    {
        // Update avatar's position on correct track
        track.place(ObjectFollowing.transform, trackPosition);

        trackPosition += Time.deltaTime * speed; // * Input.GetAxis("Vertical"); // Uncomment to have the forward and backwards controlled by the directional arrows

        if (trackPosition < 0f)                  // We need to keep the ratio between 0-1 so after one we will loop back to the beginning of the track
        {
            trackPosition = 1f;
        }
        else if (trackPosition > 1f)
        {
            trackPosition = 0f;
        }
    }