point() public method

public point ( float ratio ) : Vector3
ratio float
return Vector3
Exemplo n.º 1
0
 static public int point(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
         LTBezierPath  self = (LTBezierPath)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         var ret = self.point(a1);
         pushValue(l, true);
         pushValue(l, ret);
         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
 }
 void Update()
 {
     transform.position = ltBezierPath.point(iter);
     iter += Time.deltaTime;
     if (iter > 1.0f)
     {
         iter = 0.0f;
     }
 }
Exemplo n.º 3
0
 static public int point(IntPtr l)
 {
     try {
         LTBezierPath  self = (LTBezierPath)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         var ret = self.point(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 4
0
 static public int point(IntPtr l)
 {
     try {
         LTBezierPath  self = (LTBezierPath)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         var ret = self.point(a1);
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Exemplo n.º 5
0
 static int point(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         LTBezierPath        obj  = (LTBezierPath)ToLua.CheckObject <LTBezierPath>(L, 1);
         float               arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         UnityEngine.Vector3 o    = obj.point(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 6
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;
        }
    }
Exemplo n.º 7
0
    private void DoStart()
    {
        int[] trackIndexes = new int[] { 1, 5 };
        trackIndexes.ShuffleCrypto();

        UIManager.Instance.soundManager.mPlayer.PlayTrack(trackIndexes[0]);

        Track.PositionVehicleAtStartPosition(Vehicle);

        if (PersistentModel.Instance.GameCarnivalLoopObject.Length > 0)
        {
            CarnivalLoop       = GameObject.Find("CarnivalLoop");
            CarnivalLoopObject = Instantiate(Resources.Load(PersistentModel.Instance.GameCarnivalLoopObject)) as GameObject;
            //LTBezierPath path = new LTBezierPath(CarnivalLoop.GetComponent<LeanTweenPath>().path);
            LTBezierPath path = new LTBezierPath(
                new Vector3[] { new Vector3(134.65f, 16.7f, -27.5f), new Vector3(133.8322f, 18.95677f, -27.5f), new Vector3(134.6568f, 18.13219f, -27.5f), new Vector3(132.4f, 18.95f, -27.5f), new Vector3(132.4f, 18.95f, -27.5f), new Vector3(130.1432f, 18.13219f, -27.5f), new Vector3(130.9678f, 18.95677f, -27.5f), new Vector3(130.15f, 16.7f, -27.5f), new Vector3(130.15f, 16.7f, -27.5f), new Vector3(130.9678f, 14.44323f, -27.5f), new Vector3(130.1432f, 15.26781f, -27.5f), new Vector3(132.4f, 14.45f, -27.5f), new Vector3(132.4f, 14.45f, -27.5f), new Vector3(134.6568f, 15.26781f, -27.5f), new Vector3(133.8322f, 14.44323f, -27.5f), new Vector3(134.65f, 16.7f, -27.5f) });
            CarnivalLoopLeanTweenBezierPath       = path;
            CarnivalLoopObject.transform.position = CarnivalLoopLeanTweenBezierPath.point(CarnivalLoopLeanTweenIterator);
        }
    }
Exemplo n.º 8
0
    void Update()
    {
        // time
        if (!PersistentModel.Instance.ClockIsStopped)
        {
            Time += UnityEngine.Time.deltaTime;
            GameScreen.SetTime(Time);
        }

        if (completed || !ready || !started)
        {
            return;
        }

        if (CarnivalLoopObject)
        {
            CarnivalLoopObject.transform.position = CarnivalLoopLeanTweenBezierPath.point(CarnivalLoopLeanTweenIterator);
            CarnivalLoopLeanTweenIterator        += UnityEngine.Time.deltaTime * .01f;
            if (CarnivalLoopLeanTweenIterator > 1.0f)
            {
                CarnivalLoopLeanTweenIterator = 0.0f;
            }
        }

        if (PersistentModel.Instance.DEBUG)
        {
            GameObject speed = GameObject.Find("Speed");
            Text       text  = speed.GetComponent <Text>();
            text.text = Vehicle.Speed + " MPH";
        }

        // fog
        float current = RenderSettings.fogDensity;
        float target  = targetFogLevel;
        float diff    = current - target;

        if (diff > 0)
        {
            current -= .0001f;
        }
        else if (diff < 0)
        {
            current += .0001f;
        }

        diff = current > target ? current - target : target - current;

        if (diff != 0 && diff < .00001f)
        {
            current = target;
        }
        if (diff != 0)
        {
            RenderSettings.fogDensity = current;
        }
        if (!Started || completed)
        {
            return;
        }

        // time
        if (!PersistentModel.Instance.ClockIsStopped)
        {
            // Race Events
            raceTimeEventManager.Update(UnityEngine.Time.deltaTime);
        }
    }