void getAbilities() { try { basicMoveMent = this.GetComponentInChildren <IBasicMoveMent>(); basicMoveMent.enableAbility(this); basicMoveMent.activate(); } catch { } try { rotateArm = this.GetComponentInChildren <IRotateArm>(); rotateArm.enableAbility(this); rotateArm.deactivate(); } catch { } try { grapple = armController.GetComponentInChildren <IGrapple>(); grapple.enableAbility(this); } catch { } try { landHit = this.GetComponentInChildren <ILandHit>(); } catch { } try { slimeArm = armController.GetComponent <ISlimeArm>(); slimeArm.enableAbility(this); Debug.Log(slimeArm); } catch { Debug.LogError("No SlimeArm"); } try { teleporte = this.GetComponentInChildren <ITeleporte>(); } catch { } try { chargeArm = this.GetComponentInChildren <IChargeArm>(); } catch { } }
public void swichMoveMent() //Switch the movement way between rotating arm and walking { if (rotateArm.isEnabled()) { if (basicMoveMent.isActivate()) { // basicMoveMent.deactivate(); rotateArm.activate(); } else { // basicMoveMent.activate(); rotateArm.deactivate(); } } }