public void OnLoadSucc(object source, UnityObject unityObj) { var player = source as PlayerEntity; var fxCam = player.cameraObj.EffectCamera; var assetInfo = unityObj.Address; if (assetInfo.Equals(AssetConfig.GetCameraPoisonEffect())) { var go = unityObj.AsGameObject; if (null != go) { player.cameraFx.Poison = go.GetComponentInChildren <ParticleSystem>().gameObject; player.cameraFx.Poison.layer = UnityLayerManager.GetLayerIndex(EUnityLayerName.CameraFx); go.transform.parent = fxCam.transform; go.transform.localPosition = Vector3.zero; go.transform.localRotation = Quaternion.identity; go.transform.localScale = Vector3.one; } } }
public override void SingleExecute(PlayerEntity entity) { AssetManager.LoadAssetAsync(entity, AssetConfig.GetCameraPoisonEffect(), OnLoadSucc); }