Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        physics = GetComponent <Rigidbody2D>();

        physics.sharedMaterial.friction = stats.Friction;
        physics.gravityScale            = stats.Gravity;

        controls = Utils.GetControlsObject(playerID);

        //reflective state scripts. Think "this.self" from SSF2
        currentStateScript = (CharacterStateScript)Activator.CreateInstance(Type.GetType(scriptList[state.ToString()]), new System.Object[] { this });
    }
Ejemplo n.º 2
0
 public void SetState(CharacterState state)
 {
     this.state         = state;
     stateFrame         = 0;
     currentStateScript = (CharacterStateScript)Activator.CreateInstance(Type.GetType(scriptList[state.ToString()]), new System.Object[] { this });
 }