// ---------------------------------------------------------------------------------------------------- #endregion #region Initialization // ---------------------------------------------------------------------------------------------------- /// <summary> /// Called upon awaking this behavior. /// </summary> private void Awake() { this.effectPrefabID = effectPrefab.GetInstanceID(); this.effectPool = FeatherPoolManager.Instance.GetPool(this.effectPrefabID); this.collisionTarget = this.GetComponent <CollisionTarget>(); this.collisionTarget.OnTriggerCollision += (collisionController) => { this.effectPool.Spawn(transform.position); this.gameObject.SetActive(false); }; }
private void Awake() { movementController = GetComponent <MovementController>(); collisionTarget = GetComponent <CollisionTarget>(); collisionTarget.OnDirectionalCollision += (collisionInformation) => { StartPushing(collisionInformation.DirectionTo); }; collisionTarget.OnExitDirectional += StopPushing; collisionTarget.OnExitCollision += StopPushing; destination = transform.position; startPosition = destination; }