public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); AssianModel(); if (Model == null) { CLog.Error("Unit 没有model"); return; } ModelRenders = Model.GetComponentsInChildren <Renderer>(); { } SkinnedMeshRenderers = Model.GetComponentsInChildren <SkinnedMeshRenderer>(); { float lastSize = 0.0f; float curSize = 0.0f; foreach (var item in SkinnedMeshRenderers) { Vector3 extents = item.bounds.extents; curSize = extents.x + extents.y + extents.z; if (curSize > lastSize) { lastSize = curSize; MainSkinnedMesh = item; } } } IsEnableRenders = true; if (IsUseSurfaceMaterial) { SurfSource.InitByMgr(this); } }
/// <summary> /// 组建被添加到mono的时候 /// </summary> /// <param name="mono"></param> public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); MainCamera = Camera.main; MainCameraTrans = MainCamera.transform; HighlighterRenderer = Mono.GetComponentInChildren <HighlighterRenderer>(); }
protected void SetState(Type stateType) { BattleStateBase battleStateBase = this.currentState; this.currentState = this.stateList[stateType]; this.currentState.OnStartState((!IMono.op_True(battleStateBase)) ? null : battleStateBase.GetOnStartNextState(), stateType); }
/// <summary> /// Creates the specified employee. /// </summary> /// <param name="employee">The employee.</param> /// <param name="candidate">The candidate.</param> /// <param name="feedback">The feedback.</param> /// <returns>IMono<Review>.</returns> public static IMono<Review> Create(IMono<Employee> employee, IMono<Candidate> candidate, string feedback) { return candidate.FlatMap( c => employee.FlatMap( e => Mono.Just( new Review { Candidate = c, Employee = e, Date = DateTime.Now, Feedback = feedback }))); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); string fullpath = Const.Path_Settings; TDBSetting settings = default; if (File.Exists(fullpath)) { using (Stream stream = File.OpenRead(fullpath)) { if (stream != null) { try { settings = FileUtil.LoadJson <TDBSetting>(stream); } catch (Exception e) { settings = default; CLog.Error("载入settings出错{0}", e); } } } } if (settings == null) { IsFirstCreateSettings = true; settings = new TDBSetting(); Save(); } SetSettings(settings); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); Data.Add(SeasonType.Spring, new List <SeasonData> { new SeasonData { SunIntensity = 0.8f, AccumulatedSnow = 0.0f, WindzonePower = 0.1f, Type = SubSeasonType.Normal } }); Data.Add(SeasonType.Summer, new List <SeasonData> { new SeasonData { SunIntensity = 0.8f, AccumulatedSnow = 0.0f, WindzonePower = 0.2f, Type = SubSeasonType.Normal }, new SeasonData { SunIntensity = 0.9f, AccumulatedSnow = 0.0f, WindzonePower = 0.25f, Type = SubSeasonType.Deep } }); Data.Add(SeasonType.Fall, new List <SeasonData> { new SeasonData { SunIntensity = 0.75f, AccumulatedSnow = 0.0f, WindzonePower = 0.1f, Type = SubSeasonType.Normal } }); Data.Add(SeasonType.Winter, new List <SeasonData> { new SeasonData { SunIntensity = 0.8f, AccumulatedSnow = 0.3f, WindzonePower = 0.3f, Type = SubSeasonType.Normal }, new SeasonData { SunIntensity = 0.7f, AccumulatedSnow = 0.4f, WindzonePower = 0.45f, Type = SubSeasonType.Deep } }); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); andSimpleConditions = new List <SimpleActionCondition>(); orSimpleConditions = new List <SimpleActionCondition>(); andCacheConditions = new List <BaseActionCondition>(); orCacheConditions = new List <BaseActionCondition>(); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); #if ENABLE_TMP TextMesh = SelfBaseUnit.GetComponentInChildren <TextMeshPro>(); #endif Collider = SelfBaseUnit.GetComponentInChildren <BoxCollider>(); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); if (GetInt(Key_LastPrefsVer) != VersionMgr.Config.Prefs) { DeleteAll(); SetInt(Key_LastPrefsVer, VersionMgr.Config.Prefs); } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); ProjectorGO = GameObject.Instantiate(BaseGlobal.GRMgr.Prefab.Get(ProjectorGOStr)); Projector = ProjectorGO.GetComponent <Projector>(); ProjectorGO.transform.SetParent(SelfMono.Trans); ProjectorGO.transform.localPosition = Vector3.up; ProjectorGO.transform.localRotation = Quaternion.Euler(90, 0, 0); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); foreach (var item in LuaMgrList) { SelfBaseGlobal.LuaMgr.Callback_OnLuaParseStart += item.OnLuaParseStart; SelfBaseGlobal.LuaMgr.Callback_OnLuaParseEnd += item.OnLuaParseEnd; } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); var tempArray = Enum.GetValues(typeof(T)); _curDataPool = new float[tempArray.Length]; _baseDataPool = new float[tempArray.Length]; attrDataList = GetAttrDataList(); attrDataDic = GetAttrDataDic(); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); if (IsGlobal) { BaseGlobal.LoaderMgr.Callback_OnAllLoadEnd2 += OnAllLoadEnd2; BaseGlobal.BattleMgr.Callback_OnBattleLoaded += OnBattleLoaded; BaseGlobal.BattleMgr.Callback_OnBattleUnLoaded += OnBattleUnLoaded; } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); Animator = Mono.GetComponentInChildren <Animator>(); if (Animator == null) { CLog.Error("错误 该对象没有Animator" + Mono.name); } SourceAnimator = Animator.runtimeAnimatorController; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); VoiceAudioSource = Mono.EnsureComponet <AudioSource>(); VoiceAudioSource.playOnAwake = false; VoiceAudioSource.rolloffMode = AudioRolloffMode.Linear; VoiceAudioSource.spatialBlend = 1.0f; VoiceAudioSource.minDistance = 1.0f; VoiceAudioSource.maxDistance = DefaultMaxDistance; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); TDLuaMgr = BaseLuaMgr.GetTDLuaMgr(typeof(TData)); UnitType = typeof(TData); if (IsGlobal) { BaseGlobal.BattleMgr.Callback_OnBattleLoaded += OnBattleLoaded; BaseGlobal.BattleMgr.Callback_OnBattleUnLoaded += OnBattleUnLoaded; } }
// 组建被添加到mono的时候 public virtual void OnBeAdded(IMono mono) { SelfMono = (BaseCoreMono)mono; if (mono is BaseUnit) { SelfBaseUnit = (BaseUnit)mono; } foreach (var item in subComponets) { item.OnBeAdded(SelfMono); } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); if (InputAssetReference == null || InputAsset == null) { CLog.Error("没有配置InputConfig"); } else { GamePlayMap = TryGetActionMap("GamePlay"); MenuMap = TryGetActionMap("Menu"); } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); UnitType = typeof(TUnit); ConfigType = typeof(TConfig); TDLuaMgr = BaseLuaMgr.GetTDLuaMgr(ConfigType); if (IsGlobal) { BaseGlobal.BattleMgr.Callback_OnBattleUnLoaded += OnBattleUnLoaded; BaseGlobal.BattleMgr.Callback_OnBattleLoadedScene += OnBattleLoadedScene; BaseGlobal.LoaderMgr.Callback_OnAllLoadEnd2 += OnAllLoadEnd2; } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); InputAsset = Resources.Load <InputActionAsset>("InputConfig"); if (InputAsset == null) { CLog.Error("没有配置:InputConfig"); } else { GamePlayMap = TryGetActionMap("GamePlay"); MenuMap = TryGetActionMap("Menu"); } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); Timer = new Timer(UpdateTimer); SenseGameObj = new GameObject("SenseObj"); SenseGameObj.layer = (int)BaseConstMgr.Layer_Sense; SenseGameObj.transform.SetParent(Mono.Trans); SenseGameObj.transform.localPosition = Vector3.zero; SenseGameObj.transform.localScale = Vector3.one; SenseGameObj.transform.localRotation = Quaternion.identity; SenseObject = BaseMono.GetUnityComponet <BaseSenseObj>(SenseGameObj); SenseObject.Init(this); SphereCollider = SenseGameObj.AddComponent <SphereCollider>(); SphereCollider.isTrigger = true; SphereCollider.radius = Radius; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); Animator = AnimatorObj.GetComponentInChildren <Animator>(); if (Animator == null) { CLog.Error("错误 该对象没有Animator:" + SelfMono.name); return; } if (Animator.runtimeAnimatorController == null) { CLog.Error("错误 该对象没有runtimeAnimatorController:" + SelfMono.name); return; } Animator.cullingMode = AnimatorCullingMode.CullCompletely; SourceAnimator = Animator.runtimeAnimatorController; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); if (IsEnableDevSetting) { DevSettings = BaseFileUtils.LoadJsonOrDefault(BaseConstMgr.Path_DevSettings, CreateDefaultDevSettings()); } else { DevSettings = CreateDefaultDevSettings(); } string fullpath = BaseConstMgr.Path_Settings; TDBSetting settings = default(TDBSetting); if (File.Exists(fullpath)) { using (Stream stream = File.OpenRead(fullpath)) { if (stream != null) { try { settings = BaseFileUtils.LoadJson <TDBSetting>(stream); } catch (Exception e) { settings = default(TDBSetting); CLog.Error("载入settings出错{0}", e); } } } } if (settings == null) { IsFirstCreateSettings = true; settings = new TDBSetting(); Save(); } SetSettings(settings); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); uint appId = GetAppId(); // 使用try防止崩溃 try { SteamClient.Init(appId); } catch (Exception e) { CLog.Info("Error starting steam client: {0}", e); SteamClient.Shutdown(); } if (SteamClient.IsValid) { IsSDKInited = true; } else { SteamClient.Shutdown(); } }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); //FOWRevealer = SelfMono.SetupMonoBehaviour<FogOfWarUnit>(); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); SelfUnit = SelfBaseUnit as TUnit; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); SelfGlobal = SelfBaseGlobal as TGlobal; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); IsSDKInited = true; }
public override void OnBeAdded(IMono mono) { base.OnBeAdded(mono); RegetNode(); }