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;
        }
Exemple #2
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;
        }