public void OnCollision(ICollidable collidable)
        {
            //Console.WriteLine(collidable.GetType().FullName);

            if (collidable.Equals(this))
            {
                return;
            }

            if ((collidable as ImageDataCollisionWrapper <TCharacter>).CharacterEntity.Equals(this.CharacterEntity))
            {
                return;
            }

            Colliding = true;
            OnCollisionCallback?.Invoke((collidable as IEntityWithImageCollidable <TCharacter>).CharacterEntity);
            Colliding = false;
        }
 private void OnDestroy()
 {
     _onEnter = null;
     _onExit  = null;
 }
 private void OnDestroy()
 {
     _onStay = null;
 }
Ejemplo n.º 4
0
        public override async ETTask ExecuteTaskAsync()
        {
            Projectile = GameObject.Instantiate(CastProjectileData.ProjectilePrefab);
            Projectile.GetComponent <Collider>().enabled = false;
            Projectile.transform.position = GetParent <CombatEntity>().Position + Vector3.up;
            Projectile.GetComponent <OnTriggerEnterCallback>().OnTriggerEnterCallbackAction = (other) => { OnCollisionCallback?.Invoke(other); };
            Projectile.GetComponent <Collider>().enabled = true;
            Projectile.SetActive(true);

            TaskState = AbilityTaskState.Executing;
        }
 private void OnDestroy()
 {
     _onEnter = null;
     _onExit = null;
 }
 private void OnDestroy()
 {
     _onStay = null;
 }