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 override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる playerDirection = (C_Switch3)entity.GetNormalComponent("C_Switch3"); bezierPoint = (C_BezierPoint)entity.GetNormalComponent("C_BezierPoint"); state = (C_CharaState)entity.GetNormalComponent("C_CharaState"); state.IsJump = true; animControl = (C_DrawAnimetion)entity.GetDrawComponent("C_DrawAnimetion"); animControl.SetNowAnim("Jump"); if (playerDirection.IsRight()) { entity.transform.Angle = 330; } else if (playerDirection.IsLeft()) { entity.transform.Angle = 210; } else if (playerDirection.IsNone()) { entity.transform.Angle = 360; } entity.transform.SetPositionY += currentJumpPower; }
public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる player = EntityManager.FindWithTag("Player")[0]; childDirection = (C_Switch3)entity.GetNormalComponent("C_Switch3"); bezierPoint = (C_BezierPoint)entity.GetNormalComponent("C_BezierPoint"); state = (C_CharaState)entity.GetNormalComponent("C_CharaState"); if (childDirection.IsRight()) { entity.transform.Angle = 330; } else if (childDirection.IsLeft()) { entity.transform.Angle = 210; } else if (childDirection.IsNone()) { entity.transform.Angle = 360; } JumpingMove(); }
protected override void UpdateMove() { if (collider.IsThrough("ChildJump") && !childDirection.IsNone()) { state.IsJump = true; } if (state.IsJump) { return; } isCaught = childState.IsBeCaught(); if (isCaught) { Entity enemy = childState.GetEnemyCaughtMe(); if (!enemy.GetIsActive()) { entity.DeActive(); return; } C_Switch3 enemyDirection = (C_Switch3)enemy.GetNormalComponent("C_Switch3"); Vector2 offset = enemyDirection.IsRight() ? new Vector2(-20, 0) : new Vector2(20, 0); entity.transform.Position = enemy.transform.Position + offset; return; } base.UpdateMove(); if (childState == null) { return; } if (!childState.FollowSwitch) { return; } speed = startSpeed; // - startSpeed *(1 - energy.GetRate())* 0.5f CheckDirection(); Move(); }
private void Move() { if (childDirection.IsNone()) { } else if (childDirection.IsRight()) { if (CheckFall(true)) { return; } } else if (childDirection.IsLeft()) { if (CheckFall(false)) { return; } } entity.transform.Position = bezierPoint.GetNowPosition(); }
public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる childDirection = (C_Switch3)entity.GetNormalComponent("C_Switch3"); if (childDirection.IsRight()) { entity.transform.Angle = 360; } else if (childDirection.IsLeft()) { entity.transform.Angle = 180; } else if (childDirection.IsNone()) { entity.transform.Angle = 360; } moveAreaLeft = entity.transform.Position.X; moveAreaRight = moveAreaLeft + 500; }
public override void Active() { base.Active(); //TODO 更新コンテナに自分を入れる childDirection = (C_Switch3)entity.GetNormalComponent("C_Switch3"); bezierPoint = (C_BezierPoint)entity.GetNormalComponent("C_BezierPoint"); childDirection.SetRight(false); if (childDirection.IsRight()) { entity.transform.Angle = 360; } else if (childDirection.IsLeft()) { entity.transform.Angle = 180; } else if (childDirection.IsNone()) { entity.transform.Angle = 360; } }