public void Initialize(Animator anim, AttackBuffer buffer, Rigidbody2D rb, AirAttackTracker airAttackTracker) { this.anim = anim; this.buffer = buffer; this.rb2d = rb; this.airAttackTracker = airAttackTracker; }
void Start() { unlocks = GlobalController.save.unlocks; rb2d = GetComponent<Rigidbody2D>(); anim = GetComponent<Animator>(); options = GlobalController.save.options; this.facingRight = false; cyanMaterial = Resources.Load<Material>("Shaders/CyanFlash"); spr = GetComponent<SpriteRenderer>(); defaultMaterial = GetComponent<SpriteRenderer>().material; gunEyes = transform.Find("GunEyes").transform; gun = GetComponentInChildren<Gun>(); interaction = GetComponentInChildren<InteractAppendage>(); lastSafeOffset = this.transform.position; speedLimiter = GetComponent<SpeedLimiter>(); spriteRenderers = new List<SpriteRenderer>(GetComponentsInChildren<SpriteRenderer>(includeInactive:true)); combatActives = GetComponentsInChildren<ActiveInCombat>(includeInactive:true); diamondShine = Resources.Load("Effects/DiamondShine") as GameObject; airAttackTracker = GetComponent<AirAttackTracker>(); RefreshAirMovement(); deathEvent = Resources.Load("ScriptableObjects/Events/Player Death") as GameEvent; groundCheck = GetComponent<PlayerGroundCheck>(); groundData = groundCheck.groundData; LoadFromSaveData(GlobalController.save); EnableTriggers(); }
public void Initialize(Animator anim, AttackBuffer buffer, Rigidbody2D rb, AirAttackTracker airAttackTracker) { this.anim = anim; this.buffer = buffer; this.rb2d = rb; this.airAttackTracker = airAttackTracker; this.playerController = anim.GetComponent <PlayerController>(); }