private void Awake() { manualInput = GetComponent <ManualInput>(); ledgeChecker = GetComponentInChildren <LedgeChecker>(); animationProgress = GetComponent <AnimationProgress>(); aiProgress = GetComponentInChildren <AIProgress>(); damageDetector = GetComponentInChildren <DamageDetector>(); boxCollider = GetComponent <BoxCollider>(); navMeshObstacle = GetComponent <NavMeshObstacle>(); collisionSpheres = GetComponentInChildren <CollisionSpheres>(); collisionSpheres.owner = this; collisionSpheres.SetColliderSpheres(); aiController = GetComponentInChildren <AIController>(); if (aiController == null) { if (navMeshObstacle != null) { navMeshObstacle.carving = true; } } RegisterCharacter(); }
public CharacterControl GetPlayableCharacter() { foreach (CharacterControl control in Characters) { ManualInput manualInput = control.GetComponent <ManualInput>(); if (manualInput != null) { if (manualInput.enabled == true) { return(control); } } } return(null); }