示例#1
0
    void Start()
    {
        this.validator            = new GamePhaseValidator();
        this.trialVoteHandler     = new TrialVoteHandler(this);
        this.judgementVoteHandler = new JudgementVoteHandler(this);
        if (!SunLight)
        {
            SunLight = GameObject.Find("Directional Light").GetComponent <Light>();
        }

        this.startPhase = new StartPhase();
        this.endPhase   = new EndPhase();
        this.gameUI     = this.GetComponent <GameUI>();

        if (!playerHandler)
        {
            playerHandler = this.GetComponent <PlayerHandler>();
        }

        if (Players == null || Players.Length == 0)
        {
            Players = GameObject.FindObjectsOfType <PlayerController>();
        }

        if (!Camera)
        {
            Camera = GameObject.FindObjectOfType <WaypointCamera>();
        }
    }
示例#2
0
 public ExecutionPhase(
     GameUI gameUI,
     WaypointCamera camera,
     PlayerHandler playerHandler,
     TrialVoteHandler trialVotes,
     JudgementVoteHandler judgementVote)
     : base("Execution")
 {
     gameUi             = gameUI;
     this.camera        = camera;
     this.playerHandler = playerHandler;
     this.trialVotes    = trialVotes;
     this.judgementVote = judgementVote;
 }
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            _font        = Content.Load <SpriteFont>("MgGenFont");
            _dot         = CreateDotTexture(GraphicsDevice, Color.White);

            _camera = new WaypointCamera(GraphicsDevice, _spriteBatch, _dot, new Vector3(2, 2, 10), new Vector3(0, 0, 0), Vector3.UnitY, 0.1f, 10000f, 1f, true, false);
            _camera.TransformCamera(_camera.World.Translation, _testTarget, _camera.World.Up);
            _camera.Up = Vector3.Forward;
            _camera.WayPointCycleDurationInTotalSeconds = 20f;
            _camera.MovementSpeedPerSecond = 3f;
            _camera.SetWayPoints(_wayPoints, true, 100);

            cspline = new Curve_BezierSpline(_wayPoints, true, 0.5f);
        }
示例#4
0
    // Start is called before the first frame update
    void Start()
    {
        this.RandomizePlayerData();
        this.gameCamera = GameObject.FindObjectOfType <Camera>();
        this.wpCamera   = this.gameCamera.GetComponent <WaypointCamera>();
        if (!this.agent)
        {
            this.agent = this.gameObject.GetComponent <NavMeshAgent>();
        }

        if (this.agent)
        {
            this.DisableNavigation();
        }

        if (NameTag)
        {
            this.nameTagFarOffset  = Vector3.zero;
            this.nameTagNearOffset = Vector3.zero;
            this.NameTagRect       = this.NameTag.GetComponent <RectTransform>();
        }

        this.transform.position = new Vector3(0, -999, 0);
        this.animator           = this.GetComponent <Animator>();
        if (this.animator)
        {
            this.animator.SetFloat("Offset", UnityEngine.Random.value);
        }

        for (var i = 0; i < this.transform.childCount; ++i)
        {
            var c = this.transform.GetChild(i);
            if (!c.gameObject.activeInHierarchy)
            {
                continue;
            }

            this.modelRenderer = c.GetComponent <SkinnedMeshRenderer>();
            break;
        }
    }
示例#5
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            _font        = Content.Load <SpriteFont>("MgGenFont");
            //_generatedTexture = CreateCheckerBoard(GraphicsDevice, 20, 20, Color.White, Color.Red);
            _dot = CreateDotTexture(GraphicsDevice, Color.White);

            _camera = new WaypointCamera(GraphicsDevice, _spriteBatch, _dot, new Vector3(2, 2, 10), new Vector3(0, 0, 0), Vector3.UnitY, 0.1f, 10000f, 1f, true, false);
            _camera.TransformCamera(_camera.World.Translation, _testTarget, _camera.World.Up);
            _camera.Up = Vector3.Forward;
            _camera.WayPointCycleDurationInTotalSeconds = 20f;
            _camera.MovementSpeedPerSecond = 3f;
            _camera.SetWayPoints(_wayPoints, true, 100);

            bspline          = new Curve_SubdivisionSpline(_wayPoints);
            bezierCurveLines = new Vector3[20];
            for (int i = 0; i < 20; i++)
            {
                float t = (float)(i) / (float)(19);
                bezierCurveLines[i] = bspline.GetSplinePoint(1, t);
            }
        }
示例#6
0
    public DayPhase(
        Action <Phase> onEnter,
        Action <Phase> onExit,
        GameUI gameUI,
        WaypointCamera camera,
        PlayerHandler playerHandler,
        TrialVoteHandler trialVoteHandler,
        JudgementVoteHandler judgementVoteHandler,
        bool standardMode)
        : base(
            "Day",

            new GotoTownPhase(playerHandler),

            new ReviewNightPhase(playerHandler),

            new DiscussionPhase(
                5f),
            //standardMode ? 45f : 15f)),

            new TrialVotingPhase(
                gameUI, playerHandler, trialVoteHandler,
                30f),

            new MoveToGallowsPhase(
                gameUI, trialVoteHandler, playerHandler),

            new DefensePhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                5f),
            //20f),

            new JudgementPhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler,
                20f),

            new LeaveGallowsPhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler),

            new LastWordsPhase(
                gameUI,
                judgementVoteHandler,
                5f),

            new ExecutionPhase(
                gameUI,
                camera,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler),

            new ReviewExecutionPhase(
                gameUI,
                playerHandler,
                trialVoteHandler,
                judgementVoteHandler)
            )
    {
        this.onEnter              = onEnter;
        this.onExit               = onExit;
        this.playerHandler        = playerHandler;
        this.trialVoteHandler     = trialVoteHandler;
        this.judgementVoteHandler = judgementVoteHandler;
    }