public void CheckHurtBoxCollision(HitboxObject hBox) // Called by SendMessage [HurtBox.cs] { if (hBox.GetHitboxPlayerId() != playerID) { GetHitByAttackHitBox(hBox.GetHitboxProperties()); } }
private IObjectPool <HitboxObject> MakeNewPool(HitboxObject prefab) { return(new QueueBasedObjectPool <HitboxObject>( // We must instantiate a clone of the prefab instance as part of the contruction function, and make sure it starts off deactivated () => { var toRet = Instantiate(prefab); toRet.gameObject.SetActive(false); return toRet; }, ANIMATION_OBJ_PRE_INIT_SIZE )); }
protected virtual void InitUnitProperties() { BuffManager = gameObject.AddComponent <BuffManager>(); DisplacementManager = gameObject.AddComponent <DisplacementManager>(); EffectSourceManager = gameObject.AddComponent <EffectSourceManager>(); ForcedActionManager = gameObject.AddComponent <ForcedActionManager>(); HitboxObject = gameObject.GetComponentInChildren <Collider>().gameObject; ModelObject = gameObject.GetComponentInChildren <MeshRenderer>().gameObject; ShieldManager = gameObject.AddComponent <ShieldManager>(); PhotonView = GetComponent <PhotonView>(); HitboxObject.AddComponent <MouseEvent>(); }