Ejemplo n.º 1
0
    public override void OnRollEnd(int number, DiceType type, Poring poring = null)
    {
        stepWalking = number;

        state = DokaponGameState.plan;
        SetCamera(CameraType.TopDown);

        panelStepRemain.SetActive(true);
        ParseMovableNode();
        DisplayNodeHeat();

        bgm.ChangeVolume(0.5f);
    }
Ejemplo n.º 2
0
    public override void UpdateGameMode()
    {
        switch (state)
        {
        case DokaponGameState.focus:
            if (currentPoring == null)
            {
                return;
            }
            float distance = Vector3.Distance(currentPoring.transform.position, currentCamera.transform.position);            //print(distance);
            if (distance < 11.2f)
            {
                state         = DokaponGameState.roll;
                m_timeForRoll = TimeForRoll;

                // panelRoll.SetRoll(6);
            }
            break;

        case DokaponGameState.roll:
            m_timeForRoll -= Time.deltaTime;

            if (m_timeForRoll < 0)
            {
                Roll();
            }
            break;

        case DokaponGameState.plan:
            if (Input.GetMouseButtonDown(0))
            {
                RaycastHit hit;
                Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                if (Physics.Raycast(ray, out hit, 100.0f))
                {
                    Node node = hit.transform.parent.GetComponent <Node>();
                    if (node)
                    {
                        Debug.Log("You selected the " + node.nid);
                        SFX.PlayClip(resource.sound[0]).GetComponent <AudioSource>().time = 0.3f;
                        node.PointRenderer.SetPropertyBlock(MaterialPreset.GetMaterialPreset(EMaterialPreset.selected));

                        if (node.steps.Count > 0)
                        {
                            MagicCursor.Instance.MoveTo(node);
                            Route.Clear();
                            // PathToNode(node);
                            // foreach (Node n in PathToNode(node)) {
                            //  s += n.nid + ", ";
                            // }
                            RouteToNode(node);
                            // foreach (List)
                            //print(GetNodeString(PathToNode(node)));
                            // print(s);
                            foreach (List <Node> r in Route)
                            {
                                print(GetNodeString(r));
                            }
                        }
                    }
                }
            }
            break;
        }
    }