Exemple #1
0
    public Perso(GameObject g, PersoFiller p)
    {
        G         = g;
        transform = g.GetComponent <Transform>();
        rb        = g.GetComponent <Rigidbody>();
        anim      = g.GetComponent <Animator>();


        FillFromFiller(p);
        FillDico();
        InitiateImpulsion();
    }
Exemple #2
0
    public Perso(GameObject Holder, GameObject Avatar, PersoFiller p, Camera c)
    {
        G         = Holder;
        A         = Avatar;
        transform = G.GetComponent <Transform>();
        rb        = G.GetComponent <Rigidbody>();
        anim      = Avatar.GetComponent <Animator>();
        cam       = c;

        FillFromFiller(p);
        FillDico();
        InitiateImpulsion();
    }
Exemple #3
0
    public void FillFromFiller(PersoFiller p)
    {
        states   = p.states;
        c_states = p.c_states;

        Speed         = p.Speed;
        RotationSpeed = p.RotationSpeed;
        JumpForce     = p.JumpForce;
        MaxVelocity   = p.MaxVelocity;
        DashForce     = p.DashForce;
        DashTime      = p.DashTime;

        UsePivot   = p.UsePivot;
        PivotDelay = p.PivotDelay;

        UseLean                 = p.UseLean;
        ArmatureTransform       = p.Armature;
        MaxLeaningAngle         = -(90 + p.MaxLeaningAngle);
        LeanRight               = Quaternion.Euler(new Vector3(MaxLeaningAngle, -90, 90));
        LeanLeft                = Quaternion.Euler(new Vector3(MaxLeaningAngle, 90, -90));
        LeanSpeed               = p.LeanSpeed;
        InitialArmatureRotation = ArmatureTransform.localRotation;

        UseJumpOver               = p.UseJumpOver;
        JumpOverDirection         = p.ImpulsionComponents;
        JumpOverImpulsionDuration = p.ImpulsionDuration;
        JumpOverImpulsionStrength = p.ImpulsionStrength;
        JumpOverImpulsionDelay    = p.ImpulsionDelay;
        JumpOverDetectionDistance = p.DetectionDistance;


        AdditionalGravity = p.AdditionalGravity;
        DragFly           = p.DragFly;
        DragGround        = p.DragGround;

        height = G.GetComponent <Collider>().bounds.size.y / 2;
    }