Пример #1
0
 private void OnCollide(GameObject obj)
 {
     if (obj.Tag == GameObjectManager.TAG.Character && ownerNickname != obj.Name)
     {
         UserCondition condition = obj.GetComponent <UserCondition>();
         condition.Damage(20, ownerNickname);
         DeleteThisBullet();
     }
 }
Пример #2
0
 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);
 }