Example #1
0
 public static async Task TIME_FrozenWait(this Perso p, int milliseconds)
 {
     await new WaitForSeconds(((float)milliseconds) / 1000.0f);
 }
Example #2
0
 public static Perso GetPerso(this Perso p, string name)
 {
     return(GameObject.Find(name)?.GetComponent <Perso>());
 }
Example #3
0
 public static bool Cond_IsCustomBitSet(this Perso p, int index)
 {
     // Rayman 2 uses indexes here that start with 1 instead of 0
     return(p.customBits.GetCustomBit(index - 1));
 }
Example #4
0
 public static float Func_Cosinus(this Perso p, float a)
 {
     return((float)Math.Cos((a / 180) * Math.PI));
 }
Example #5
0
 // Interpolate between two vectors linearly with a certain factor. Temporal is used to indicate that it should be t
 public static Vector3 VEC_TemporalVectorCombination(this Perso p, Vector3 a, float factor, Vector3 b)
 {
     return(a + (b - a) * factor);
 }
Example #6
0
 public static void Proc_ChangeOneCustomBit(this Perso p, int index, bool value)
 {
     // Rayman 2 uses indexes here that start with 1 instead of 0
     p.customBits.SetCustomBit(index - 1, value);
 }
Example #7
0
 public static float Func_AbsoluteValue(this Perso p, float v)
 {
     return((float)Math.Abs(v));
 }
Example #8
0
 public static Vector3 Func_Normalize(this Perso p, Vector3 vector3)
 {
     return(vector3.normalized);
 }
Example #9
0
 public static float PadHorizontalAxis(this Perso p)
 {
     return((Input.GetAxisRaw("Horizontal") * 160) * 0.5f);
 }
Example #10
0
 public static float PadVerticalAxis(this Perso p)
 {
     return((-Input.GetAxisRaw("Vertical") * 160) * 0.5f);
 }
Example #11
0
        public static float VEC_AngleVector(this Perso p, Vector3 a, Vector3 b, int mode) // Dot product, mode = radians, degrees or something
        {
            float result = Vector3.Dot(a, b);

            return(result);
        }
Example #12
0
 public static float Func_GetDeltaTime(this Perso p) // delta time as int is gross
 {
     return(Time.deltaTime * 1000.0f);
 }
Example #13
0
 public static int Func_Int(this Perso p, float value)
 {
     return((int)value);
 }
Example #14
0
 public static float VEC_GetVectorNorm(this Perso p, Vector3 vector3)
 {
     return(vector3.magnitude);
 }
Example #15
0
 public static Vector3 Position(this Perso p)
 {
     return(p.transform.position);
 }
Example #16
0
 public static int Func_GetTime(this Perso p)
 {
     // Return time since level load in milliseconds
     return((int)(Time.timeSinceLevelLoad * 1000));
 }
Example #17
0
 public static int Func_RandomInt(this Perso p, int v1, int v2)
 {
     return(UnityEngine.Random.Range(v1, v2));
 }
Example #18
0
        private bool delayUpdate = false; // Updates need to be delayed one frame when an object has just been created

        public StateMachine(Perso perso)
        {
            this.Perso = perso;

            ActiveState = null;
        }
Example #19
0
 public static void fn_p_stJFFTXTProcedure(this Perso p, int textIndex, Vector3 position, string text, byte alpha)
 {
     Rayman2Text.DrawText(textIndex, position, text, alpha);
 }