public override void OnActivate(GameObject go) { base.OnActivate(go); Debug.Log("Activating Control Reversal"); motor = go.GetComponent <Motor2D>(); origJumpSpeed = motor.jumpVelocity; motor.jumpVelocity = modifiedJumpSpeed; }
// Use this for initialization void Start() { //Get Animation anim = GetComponent <Animator> (); sr = GetComponent <SpriteRenderer> (); initialScale = gameObject.transform.localScale; motor = GetComponent <Motor2D> (); }
void Awake() { _combat = GetComponent <CombatController>(); _motor = GetComponent <Motor2D>(); _specialAbility = GetComponent <CharacterSpecialAbility>(); #if UNITY_EDITOR _prevPosition = transform.position; #endif }
public override void OnActivate(GameObject go) { base.OnActivate(go); Debug.Log("Activating Speed Modifier"); _motor = go.GetComponent <Motor2D>(); _origVel = _motor.maxVelocity; _origAcc = _motor.moveAccel; if (affectAcceleration) { _motor.moveAccel = limitedAcceleration; } if (affectMaxVelocity) { _motor.maxVelocity = limtedMaxVelocity; } }