Example #1
0
        private void CreatRoute()
        {
            if (createRouteArea.ThroughEnd("PlayerSkill"))
            {
                C_SeasonState season = (C_SeasonState)createRouteArea.GetOtherEntity("PlayerSkill").GetUpdateComponent("C_SeasonState");
                if (season.GetNowSeason() != eSeason.Winter)
                {
                    return;
                }
                C_Collider_Circle playerSkillCollider = (C_Collider_Circle)createRouteArea.GetOtherCollider("PlayerSkill");
                Vector2           colliderCentre      = playerSkillCollider.centerPosition;
                float             radius = playerSkillCollider.radius;

                Vector2 lt        = createRouteArea.points[0];
                Vector2 rb        = createRouteArea.points[1];
                Vector2 rayNormal = Vector2.Normalize(rb - lt);

                Vector2 crossPoint1 = lt;
                Vector2 crossPoint2 = lt;

                Method.Circle_Ray(ref colliderCentre, lt, rayNormal, radius, ref crossPoint1, ref crossPoint2);

                crossPoint1 = crossPoint1.X > rb.X ? rb : crossPoint1;
                crossPoint2 = crossPoint2.X > rb.X ? rb : crossPoint2;

                //射線あたり判定からルート生成の始点と終点をゲット
                if (crossPoint1 == crossPoint2)
                {
                    return;
                }
                CreatRoute(crossPoint1, crossPoint2);
            }
        }
Example #2
0
        private void Purify()
        {
            if (isPurify)
            {
                return;
            }
            if (!collider.ThroughStart("PlayerSkill"))
            {
                return;
            }
            if (myState.GetNowSeason() != eSeason.None)
            {
                return;
            }
            if (otherState == null)
            {
                otherState = (C_SeasonState)collider.GetOtherEntity("PlayerSkill").GetUpdateComponent("C_SeasonState");
            }

            isPurify   = true;
            nextSeason = otherState.GetNowSeason();
            effectTimer.Initialize();
            drawComp.SetShaderOn(effectTimer.GetLimitTime() - 0.01f, "A_Shrub_" + nextSeason, "ShrubMask");
            if (nextSeason == eSeason.Spring)
            {
                drawComp.SetDepth(18);
            }
        }
Example #3
0
        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");
        }
Example #4
0
        public override void Active()
        {
            base.Active();
            //TODO 更新コンテナに自分を入れる

            UpdateComponent fallComp = new C_StaticEntityFall();

            entity.RegisterComponent(fallComp);

            myState = new C_SeasonState(eSeason.None);
            entity.RegisterComponent(myState);

            collider = new C_Collider_Circle("Shrub", new Vector2(0, -150), 150);
            entity.RegisterComponent(collider);

            drawComp    = (C_DrawAnimetion)entity.GetDrawComponent("C_DrawAnimetion");
            playerState = (C_PlayerState)EntityManager.FindWithName("Player")[0].GetNormalComponent("C_PlayerState");
        }