public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる player = EntityManager.FindWithTag("Player")[0]; childDirection = (C_Switch3)entity.GetNormalComponent("C_Switch3"); state = (C_CharaState)entity.GetNormalComponent("C_CharaState"); bezierPoint = (C_BezierPoint)entity.GetNormalComponent("C_BezierPoint"); childState = (C_ChildState)entity.GetNormalComponent("C_ChildState"); energy = (C_Energy)entity.GetNormalComponent("C_Energy"); collider = entity.GetColliderComponent("Squirrel"); draw = (C_DrawAnimetion)entity.GetDrawComponent("C_DrawAnimetion"); restExpend = energy.GetLimitEnery() / 60 / 50; //50秒で体力尽き moveExpend = energy.GetLimitEnery() / 60 / 20 + restExpend; if (childDirection.IsRight()) { entity.transform.Angle = 360; } else if (childDirection.IsLeft()) { entity.transform.Angle = 180; } else if (childDirection.IsNone()) { entity.transform.Angle = 360; } }
public C_DrawEnergyBar(C_Energy energyBar, float offsetY, float depth = 100, float alpha = 0.5f) { this.alpha = alpha; this.depth = depth; this.energyBar = energyBar; this.offsetY = offsetY; }
protected override void Initialize(Entity entity) { deadCheck = (C_EntityDeadCheck)entity.GetUpdateComponent("C_EntityDeadCheck"); energy = (C_Energy)entity.GetNormalComponent("C_Energy"); state = (C_CharaState)entity.GetNormalComponent("C_CharaState"); entity.RegisterComponent(jumpComp); }
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 override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる seasonState = new C_SeasonState(); entity.RegisterComponent(seasonState); entity.RegisterComponent(new C_DrawSeasonUI(seasonState)); collider = new C_Collider_Circle("Player", new Vector2(0, -120), 80, eCollitionType.Jostle); entity.RegisterComponent(collider); energy = (C_Energy)entity.GetNormalComponent("C_Energy"); }
public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる UpdateComponent fallComp = new C_JumpWithSquirrelAI(Parameter.PlayerLimitSpeed, false); entity.RegisterComponent(fallComp); collider = new C_Collider_Circle("Squirrel", new Vector2(0, -30), 50); entity.RegisterComponent(collider); childDirect = (C_Switch3)entity.GetNormalComponent("C_Switch3"); childState = (C_ChildState)entity.GetNormalComponent("C_ChildState"); childHP = (C_Energy)entity.GetNormalComponent("C_Energy"); playerState = (C_PlayerState)TaskManager.GetNormalComponent(EntityManager.FindWithName("Player")[0], "C_PlayerState")[0]; }
public override void Update() { if (isDisapear) { disapearTimer.Update(); if (disapearTimer.IsTime) { CreatEffect(); entity.DeActive(); } } else { if (collider.IsThrough("Squirrel")) { isDisapear = true; C_Energy childHP = (C_Energy)collider.GetOtherEntity("Squirrel").GetNormalComponent("C_Energy"); childHP.Heal(childHP.GetLimitEnery()); drawComp.SetShaderOn(disapearTimer.GetLimitTime() + 0.1f, "A_Apple_Idle", "ShadeMask_Circle"); drawComp.SetShaderCreatment(false); } } }