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