Beispiel #1
0
 public static async Task TIME_FrozenWait(this Perso p, int milliseconds)
 {
     await new WaitForSeconds(((float)milliseconds) / 1000.0f);
 }
Beispiel #2
0
 public static Perso GetPerso(this Perso p, string name)
 {
     return(GameObject.Find(name)?.GetComponent <Perso>());
 }
Beispiel #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));
 }
Beispiel #4
0
 public static float Func_Cosinus(this Perso p, float a)
 {
     return((float)Math.Cos((a / 180) * Math.PI));
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #7
0
 public static float Func_AbsoluteValue(this Perso p, float v)
 {
     return((float)Math.Abs(v));
 }
Beispiel #8
0
 public static Vector3 Func_Normalize(this Perso p, Vector3 vector3)
 {
     return(vector3.normalized);
 }
Beispiel #9
0
 public static float PadHorizontalAxis(this Perso p)
 {
     return((Input.GetAxisRaw("Horizontal") * 160) * 0.5f);
 }
Beispiel #10
0
 public static float PadVerticalAxis(this Perso p)
 {
     return((-Input.GetAxisRaw("Vertical") * 160) * 0.5f);
 }
Beispiel #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);
        }
Beispiel #12
0
 public static float Func_GetDeltaTime(this Perso p) // delta time as int is gross
 {
     return(Time.deltaTime * 1000.0f);
 }
Beispiel #13
0
 public static int Func_Int(this Perso p, float value)
 {
     return((int)value);
 }
Beispiel #14
0
 public static float VEC_GetVectorNorm(this Perso p, Vector3 vector3)
 {
     return(vector3.magnitude);
 }
Beispiel #15
0
 public static Vector3 Position(this Perso p)
 {
     return(p.transform.position);
 }
Beispiel #16
0
 public static int Func_GetTime(this Perso p)
 {
     // Return time since level load in milliseconds
     return((int)(Time.timeSinceLevelLoad * 1000));
 }
Beispiel #17
0
 public static int Func_RandomInt(this Perso p, int v1, int v2)
 {
     return(UnityEngine.Random.Range(v1, v2));
 }
Beispiel #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;
        }
Beispiel #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);
 }