Example #1
0
        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;
            }
        }
Example #2
0
        public override void Active()
        {
            base.Active();
            //TODO 更新コンテナに自分を入れる

            UpdateComponent moveComp = new C_FlyWithBirdAI(3);

            entity.RegisterComponent(moveComp);

            collider = new C_Collider_Circle("Bird", new Vector2(0, -30), 30);
            entity.RegisterComponent(collider);

            childState = (C_ChildState)entity.GetNormalComponent("C_ChildState");
        }
Example #3
0
        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];
        }
Example #4
0
        private void SurrenderChild(Entity entity)
        {
            Entity child = ((C_PlayerState)entity.GetNormalComponent("C_PlayerState")).GetOneChild();

            if (child.GetName() == "Null")
            {
                return;
            }
            C_DrawAnimetion drawChild  = (C_DrawAnimetion)child.GetDrawComponent("C_DrawAnimetion");
            C_ChildState    childState = (C_ChildState)child.GetNormalComponent("C_ChildState");

            drawChild.SetNowAnim("Catch");
            Entity       eagle      = collider.GetOtherEntity("Eagle");
            C_EnemyState eagleState = (C_EnemyState)eagle.GetNormalComponent("C_EnemyState");

            eagleState.SetCaughtChild();
            childState.SetEnemyCatchMe(eagle);
        }