示例#1
0
        public void AnalyzeColor(ColorType type)
        {
            state = LobotState.CHECK_COLOR;

            switch (type)
            {
            case ColorType.RED:
                red_effect.SetActive(true);
                break;

            case ColorType.BLUE:
                blue_effect.SetActive(true);
                break;

            case ColorType.GREEN:
                green_effect.SetActive(true);
                break;

            case ColorType.YELLOW:
                yellow_effect.SetActive(true);
                break;
            }
            now_check  = type;
            time_count = 0;
        }
示例#2
0
 ///<summary> 移動処理終了 </summary>
 public void FinishMove()
 {
     // マップ座標を更新
     positionOnMap += new Vector2Int(move_delta.x, move_delta.y);
     move_delta     = Vector2Int.zero;
     time_count     = 0;
     state          = LobotState.WAIT;
 }
示例#3
0
        public void Gain(MapType type, Action onSuccess, Action onFail)
        {
            is_clear = (type == MapType.GOAL);

            success = onSuccess;
            fail    = onFail;

            state = LobotState.GAIN;
        }
示例#4
0
        private void FinishGain()
        {
            time_count     = 0;
            state          = LobotState.WAIT;
            is_set_hop_pos = true;

            if (is_clear)
            {
                Debug.Log("success");
                success();
            }
            else
            {
                fail();
                Debug.Log("fail");
            }
        }
示例#5
0
        ///<summary> 車体の向きを変更する </summary>
        public void Look(int dx, int dy)
        {
            // 斜めはありえない
            if (dx == 0)
            {
                if (dy > 0)
                {
                    drotate = new Vector3(0, 0, 180f) - transform.rotation.eulerAngles;
                }
                else
                {
                    drotate = new Vector3(0, 0, 0) - transform.rotation.eulerAngles;
                }
            }
            else
            {
                if (dx > 0)
                {
                    drotate = new Vector3(0, 0, 270f) - transform.rotation.eulerAngles;
                }
                else
                {
                    drotate = new Vector3(0, 0, 90f) - transform.rotation.eulerAngles;
                }
            }

            // deltaが270だったら、90に変換する
            if (drotate.z == 270)
            {
                drotate.z = -90;
            }
            else if (drotate.z == -270)
            {
                drotate.z = 90;
            }

            state = LobotState.LOOK;
        }
示例#6
0
        private void FinishAnalyzeColor()
        {
            state = LobotState.WAIT;
            switch (now_check)
            {
            case ColorType.RED:
                red_effect.SetActive(false);
                break;

            case ColorType.BLUE:
                blue_effect.SetActive(false);
                break;

            case ColorType.GREEN:
                green_effect.SetActive(false);
                break;

            case ColorType.YELLOW:
                yellow_effect.SetActive(false);
                break;
            }
            now_check  = ColorType.BRANK;
            time_count = 0;
        }
示例#7
0
 private void FinishAnalyzeSound()
 {
     state = LobotState.WAIT;
     sound_effect.SetActive(false);
 }
示例#8
0
 public void AnalyzeSound()
 {
     state = LobotState.CHECK_SOUND;
     sound_effect.SetActive(true);
 }
示例#9
0
 private void FinishLook()
 {
     time_count = 0;
     state      = LobotState.MOVE;
     drotate    = Vector3.zero;
 }