private void CreatEffect() { if (isSleep) { return; } if (imageNames.Count == 0) { return; } if (seasonState == null) { seasonState = (C_SeasonState)entity.GetUpdateComponent("C_SeasonState"); } if (seasonState.GetNowSeason() == eSeason.Spring) { return; } if (seasonState.GetNowSeason() == eSeason.Autumn) { return; } creatTimer.Update(); }
protected override void Initialize(Entity entity) { entity.RegisterComponent(moveComp); routeEffect = (C_DrawRouteEffect)entity.GetDrawComponent("C_DrawRouteEffect"); routeEffect.Awake(); seasonState = (C_SeasonState)entity.GetUpdateComponent("C_SeasonState"); energy = (C_Energy)entity.GetNormalComponent("C_Energy"); state = (C_CharaState)entity.GetNormalComponent("C_CharaState"); }
public C_DrawSeasonUI(C_SeasonState seasonState, float depth = 100, float alpha = 1) { this.seasonState = seasonState; this.alpha = alpha; this.depth = depth; graphicsDevice = Renderer_2D.GetGraphicsDevice(); effect = ResouceManager.GetEffect("CircleBar").Clone(); effect.Parameters["WorldViewProjection"].SetValue(Camera2D.GetView() * Camera2D.GetProjection()); effect.CurrentTechnique = effect.Techniques["Technique1"]; vertexPositions = new VertexPositionTexture[4]; }
/// <summary> /// 初期化 /// </summary> public void Initialize() { isEnd = false; resourceLoader.Initialize(); totalResouceNum = resourceLoader.Count; resourceManager.LoadFont("HGPop"); resourceManager.LoadTextures("A_Player_Run", "./IMAGE/Animetions/"); for (int i = 0; i < 4; i++) { resourceManager.LoadTextures("P_Flower_" + i, "./IMAGE/Particles/"); } resourceManager.LoadTextures("P_Rain", "./IMAGE/Particles/"); resourceManager.LoadTextures("P_Leaf", "./IMAGE/Particles/"); resourceManager.LoadEffect("PaticleShader", "./EFFECT/"); resourceManager.LoadEffect("MaskShader", "./EFFECT/"); entity = Entity.CreateEntity("Empty", "Empty", new Transform2D()); entity.transform.Position = new Vector2(startX, 1020); entity.RegisterComponent(new C_Switch3()); C_BezierPoint bezier = new C_BezierPoint(); entity.RegisterComponent(bezier); C_DrawAnimetion drawComp = new C_DrawAnimetion(Vector2.One * 256, 16); drawComp.AddAnim("Run", new AnimData(13, 4, 0.02f, "A_Player_Run")); entity.RegisterComponent(drawComp); drawComp.SetNowAnim("Run"); drawComp.SetSize(0.7f); C_SeasonState season = new C_SeasonState(eSeason.Summer); C_DrawRouteEffect route = new C_DrawRouteEffect(); route.RegisterImage("P_Flower_", 4); route.SetState(0.02f, 10, -85); route.SetAliveSecond(2); route.SetSize(new Vector2(0.5f, 0.5f)); entity.RegisterComponent(season); entity.RegisterComponent(route); }
protected override void Initialize(Entity entity) { seasonState = (C_SeasonState)entity.GetUpdateComponent("C_SeasonState"); routeEffect = (C_DrawRouteEffect)entity.GetDrawComponent("C_DrawRouteEffect"); }