void OnSetDirection(CircleGestureReader.Direction newDirection) { if (newDirection == CircleGestureReader.Direction.CCW) { circle.fillClockwise = false; } else if (newDirection == CircleGestureReader.Direction.CW) { circle.fillClockwise = true; } }
void Awake() { if (gestureReader == null) { gestureReader = GetComponent<CircleGestureReader>(); } if (gestureReader == null) { Debug.Log("No circle gesture reader on Player Input!"); } }
// find aggregated objects void Awake() { #region check aggrigated classes/components if (input == null) { input = GetComponent<PlayerInput>(); } if (movement == null || myProperties.myMovement == null) { movement = GetComponent<PlayerMovement>(); movement.myOwner = this; myProperties.myMovement = movement; } if (playerAnimation == null) { playerAnimation = GetComponent<PlayerAnimation>(); } if (playerSounds == null) { playerSounds = transform.Find("Sounds").GetComponent<PlayerSounds>(); } if (circleGesture == null) { circleGesture = GetComponent<CircleGestureReader>(); } if (updateControllers == null || updateControllers.Length == 0) { updateControllers = GetComponentsInChildren<UpdateController>(); } if (punchCircle == null) { punchCircle = transform.Find("PunchUI").GetComponent<PunchCircle>(); } if (dashCircle == null) { dashCircle = transform.Find("Geometry/DashUI").GetComponent<CooldownUI>(); } if (stompCircle == null) { stompCircle = transform.Find("StompUI").GetComponent<CooldownUI>(); } if (col == null) { col = geometry.GetComponent<Collider>(); } // parent of the actual player model if (geometry == null) { geometry = transform.Find("Geometry"); } // get Animator from player geometry if (geometry != null && anim == null) { anim = geometry.GetComponentInChildren<Animator>(); } // get punch animation event if (anim != null && animEvents == null) { animEvents = anim.GetComponent<LivingAnimationEvents>(); } if (this.myProperties.myPerception == null) { this.myProperties.myPerception = this.GetComponent<Perception>(); this.myProperties.myPerception.myOwner = this; } if (this.myProperties.myAttack == null) { this.myProperties.myAttack = transform.Find("Attacks").GetComponent<PlayerAttack>(); } //this.myProperties.myTargetting = this.GetComponent<Targetting>(); //this.myProperties.myTargetting.myOwner = this; if (input == null || movement == null || playerAnimation == null || playerSounds == null|| anim == null || animEvents == null || col == null) { Debug.LogError("Key Component Missing on " + this); this.enabled = false; return; } if (myProperties.myAttack == null || myProperties.myPerception == null || circleGesture == null || punchCircle == null) { Debug.LogError("Attack Component Missing on " + this); this.enabled = false; return; } // CHARGE INPUT TYPE if (chargeType == ChargeType.Trigger && circleGesture != null) { circleGesture.enabled = false; } #endregion StartListening(); }