private void OnCollide(GameObject obj) { if (obj.Tag == GameObjectManager.TAG.Character && ownerNickname != obj.Name) { UserCondition condition = obj.GetComponent <UserCondition>(); condition.Damage(20, ownerNickname); DeleteThisBullet(); } }
public override void OnCreate(GameObject gameObj) { base.OnCreate(gameObj); position = new Vector3((float)random.NextDouble() * width, (float)random.NextDouble() * height, 0.0f); this.mediator = this.gameObject.UserMediator; this.session = this.mediator.GetSession(this.gameObject.Name); condition = this.AddComponent <UserCondition>() as UserCondition; coll = this.AddComponent <Circle2DCollider>() as Circle2DCollider; coll.SetCollider(position, CharacterRadius); }