/*private void EnableAutoPickup(int entityId, GameObject normalCollider) * { * var listener = normalCollider.GetComponent<SceneObjectTriggerEnterListener>(); * if (listener == null) * { * listener = normalCollider.AddComponent<SceneObjectTriggerEnterListener>(); * } * listener.SetEntityId(entityId); * }*/ protected void ProcessSceneObjectSetting(SceneObjectEntity entity, GameObject model) { var target = SceneObjectGoAssemble.Assemble(model, entity); if (entity.hasEffects) { foreach (var effect in entity.effects.GlobalEffects) { _effectManager.AddGameObject(effect, model); } } if (entity.hasWeaponObject) { ProcessWeaonCastSetting(entity, target); } else if (entity.hasSimpleItem) { ProcessSimpleEquipment(entity, target); } }
protected void InitSceneObject(SceneObjectEntity entity, GameObject model) { var target = SceneObjectGoAssemble.Assemble(model, entity); if (entity.hasSize) { var size = Mathf.Max(1f, entity.size.Value); model.transform.localScale = Vector3.one * entity.size.Value; target.transform.localScale = Vector3.one / size; } if (entity.hasEffects) { foreach (var effect in entity.effects.GlobalEffects) { _contexts.session.clientSessionObjects.GlobalEffectManager.AddGameObject(effect, model); } } if (entity.hasSimpleEquipment) { ProcessSimpleEquipment(entity, target); } else if (entity.hasWeaponObject) { if (SingletonManager.Get <WeaponResourceConfigManager>().IsC4(entity.weaponObject.ConfigId)) { target.transform.localPosition = new Vector3(0, 0.5f, 0); } else { target.transform.localPosition = new Vector3(-0.5f, 0, 0); } ProcessWeapon(entity, target); } }