private void InitProjectile(int id, IPlayerPawn source, IMapProjectileLogic logic, MapProjectileCallback cb) { Class = ProjectileClassLoader.GetProjectileClassById(id); if (Class == null) { Debug.LogFormat("Invalid projectile created (id={0})", id); return; } Source = source; Logic = logic; if (Logic != null) { Logic.SetProjectile(this); } Callback = cb; Width = 1; Height = 1; Alpha = 1f; Color = new Color(1, 1, 1, 1); ZOffset = 128; Scale = 1; DoUpdateView = true; }
private void InitProjectile(int id, IPlayerPawn source, IMapProjectileLogic logic, MapProjectileCallback cb) { ClassID = (AllodsProjectile)id; Class = ProjectileClassLoader.GetProjectileClassById(id); if (Class == null) { // make sure that at least ID is valid if (!Enum.IsDefined(typeof(AllodsProjectile), id)) { // otherwise spam log Debug.LogFormat("Invalid projectile created (id={0})", id); return; } } Source = source; Logic = logic; if (Logic != null) { Logic.SetProjectile(this); } Callback = cb; Width = 1; Height = 1; Alpha = 1f; Color = new Color(1, 1, 1, 1); ZOffset = 128; Scale = 1; DoUpdateView = true; }
private void ClassLoadThreadProc() { try { TemplateLoader.LoadTemplates(); ObstacleClassLoader.InitClasses(); StructureClassLoader.InitClasses(); UnitClassLoader.InitClasses(); ItemClassLoader.InitClasses(); ProjectileClassLoader.InitClasses(); ClassLoadThreadDone = true; } catch (Exception e) { Debug.LogErrorFormat("Exception while loading classes.\n{0}", e.ToString()); ClassLoadThreadDone = true; } }