コード例 #1
0
 void Clear()
 {
     while (groups.Count > 0)
     {
         Destroy(groups[groups.Count - 1]);
         groups.RemoveAt(groups.Count - 1);
     }
     selectedGroup.type = ForceTravel.TravelType.None;
     Travel             = null;
     CalculateTime();
 }
コード例 #2
0
ファイル: MissionStart.cs プロジェクト: Dakuseiba/RPG_Dungeon
    public void SetPanel(ForceTravel _travel, ForceTravel.TravelEvent type)
    {
        mission = new Mission(_travel, type);
        switch (mission.travelEvent)
        {
        case ForceTravel.TravelEvent.Ambush:
            T_MissionName.text = "Zasadzka!";
            break;

        case ForceTravel.TravelEvent.Mission:
            T_MissionName.text = "Misja";
            break;
        }
    }
コード例 #3
0
ファイル: TravelSlot.cs プロジェクト: Dakuseiba/RPG_Dungeon
    void Update_Icon()
    {
        ForceTravel travel      = StaticValues.TeamTravels[idTravel];
        int         currentTime = travel.tempTime - travel.timeTravel;

        BetweenPoint points = null;
        int          ptime  = 0;
        int          time   = 0;

        foreach (var point in travel.pointList.betweenPoints)
        {
            time += point.Time;
            if (time >= currentTime)
            {
                points = point;
                time   = currentTime - ptime;
                break;
            }
            ptime = time;
        }
        if (points != null)
        {
            var     componentRoute = GetComponentInParent <MapScript>().GetComponentInChildren <ControllRoute>();
            var     route          = componentRoute.Routes[points.RouteID].GetComponent <Route>();
            float   ftime          = (float)time / (float)points.Time;
            Vector2 iconPosition;
            if (points.startId == route.pointId1)
            {
                iconPosition = Mathf.Pow(1 - ftime, 3) * route.GetPoint(0).position +
                               3 * Mathf.Pow(1 - ftime, 2) * ftime * route.GetPoint(1).position +
                               3 * (1 - ftime) * Mathf.Pow(ftime, 2) * route.GetPoint(2).position +
                               Mathf.Pow(ftime, 3) * route.GetPoint(3).position;
            }
            else
            {
                iconPosition = Mathf.Pow(1 - ftime, 3) * route.GetPoint(3).position +
                               3 * Mathf.Pow(1 - ftime, 2) * ftime * route.GetPoint(2).position +
                               3 * (1 - ftime) * Mathf.Pow(ftime, 2) * route.GetPoint(1).position +
                               Mathf.Pow(ftime, 3) * route.GetPoint(0).position;
            }
            Travel_Icon.transform.position = iconPosition;
        }
    }
コード例 #4
0
ファイル: TravelSlot.cs プロジェクト: Dakuseiba/RPG_Dungeon
    public void SetSlot(int id, GameObject travelIcon)
    {
        Travel_Icon = travelIcon;
        idTravel    = id;
        ForceTravel travel = StaticValues.TeamTravels[idTravel];

        switch (travel.typeSend)
        {
        case ForceTravel.TravelType.Go_Mission:
            T_From.text  = "Idą na misję:";
            T_Where.text = "" + ReturnName(travel.idSend, travel.typeSend);
            break;

        case ForceTravel.TravelType.Back_Mission:
            T_From.text  = "Wracają z misji:";
            T_Where.text = "" + ReturnName(travel.idSend, travel.typeSend);
            break;

        case ForceTravel.TravelType.Camp:
            switch (travel.typeBack)
            {
            case ForceTravel.TravelType.Camp:
                T_From.text  = "Zmiana obozu";
                T_Where.text = "";
                break;

            default:
                T_From.text  = "Z: " + ReturnName(travel.idBack, travel.typeBack);
                T_Where.text = "Do: " + ReturnName(travel.idSend, travel.typeSend);
                break;
            }
            break;

        default:
            T_From.text  = "Z: " + ReturnName(travel.idBack, travel.typeBack);
            T_Where.text = "Do: " + ReturnName(travel.idSend, travel.typeSend);
            break;
        }
        T_AmountChar.text = "Ilość postaci: " + travel.characters.Count;
        SetTime();
    }
コード例 #5
0
 public Mission(ForceTravel _travel, ForceTravel.TravelEvent type)
 {
     travel      = _travel;
     travelEvent = type;
 }
コード例 #6
0
 public Mission(Mission mission)
 {
     travel      = mission.travel;
     travelEvent = mission.travelEvent;
 }
コード例 #7
0
 void CreateTravel()
 {
     Travel          = new ForceTravel();
     Travel.typeSend = TravelType;
     Travel.idSend   = idPoint;
 }
コード例 #8
0
    void Update()
    {
        FixItemInfo(currentCanvas.GetComponent <GUIControll>().ItemInfoWindow);
        Debug.Log("Test " + StaticValues.Items.Weapons[3].Ammunition.Amount);
        switch (currentCanvas.GetComponent <GUIControll>().GUIEnabled.Type)
        {
        case Class_GUI.GUI_Type.HUB:
            #region Test
            if (Input.GetKeyDown(KeyCode.C) && StaticValues.Team.Count < StaticValues.Camp.UnitMax)
            {
                ChMercenary Mercenary = new ChMercenary();
                Mercenary.CreateRandom();
                StaticValues.Team.Add(Mercenary);
                StaticValues.Camp.Calculate_DayliCost();
            }
            Team = StaticValues.Team;
            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                for (int i = 0; i < StaticValues.Team.Count; i++)
                {
                    StaticValues.Team[i].GetExp(100);
                }
            }
            if (Input.GetKeyDown(KeyCode.I))
            {
                Item item = StaticValues.Items.Consumes[0];
                StaticValues.InvMagazine.AddItem(item, 1);
                item = StaticValues.Items.Throws[0];
                StaticValues.InvMagazine.AddItem(item, 1);
            }
            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                var result = PointList.IdPoints(1, 7);
                foreach (var point in result.betweenPoints)
                {
                    Debug.Log(point.startId + " " + point.endId + " " + point.Time);
                }
                Debug.Log(result.Time);
            }
            if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                if (StaticValues.Team.Count > 0)
                {
                    /*var item = new IWeapon(StaticValues.Items.Weapons[0]);
                     * StaticValues.Team[0].Equipment.Backpack.AddItem(item, 1);*/
                    IWeapon item = new IWeapon(StaticValues.Items.Weapons[0]);
                    StaticValues.InvMagazine.AddItem(item, 1);
                    item = new IWeapon(StaticValues.Items.Weapons[2]);
                    StaticValues.InvMagazine.AddItem(item, 1);
                    item = new IWeapon(StaticValues.Items.Weapons[3]);
                    StaticValues.InvMagazine.AddItem(item, 1);
                    Debug.Log(item.Name + " " + item.Ammunition.Amount);
                }
            }
            if (Input.GetKeyDown(KeyCode.Keypad1))
            {
                StaticValues.Money += 10;
            }
            if (Input.GetKeyDown(KeyCode.R))
            {
                bool isExist = false;
                for (int i = 0; i < StaticValues.Recipe.Count; i++)
                {
                    if (StaticValues.Recipe[i] == StaticValues.Items.Recipes[0])
                    {
                        isExist = true;
                        break;
                    }
                }
                if (!isExist)
                {
                    StaticValues.Recipe.Add(StaticValues.Items.Recipes[0]);
                }
            }
            if (Input.GetKeyDown(KeyCode.T))
            {
                for (int j = 0; j < StaticValues.Cities[0].TypeUpgrade.Count; j++)
                {
                    Debug.Log(j + ". " + StaticValues.Cities[0].TypeUpgrade[j]);
                }
            }
            if (Input.GetKeyDown(KeyCode.Keypad2))
            {
                SetCampID();
            }
            if (Input.GetKeyDown(KeyCode.Keypad9))
            {
                ForceTravel ft = new ForceTravel();
                ft.characters = StaticValues.Team;
                Mission mis = new Mission(ft, ForceTravel.TravelEvent.Ambush);
                StaticValues.mission = mis;
                StaticValues.headSceneManager.ChangeScene("Mission");
            }
            #endregion
            CountPanel_Update();
            break;

        case Class_GUI.GUI_Type.Mission:
            //FindObjectOfType<MissionController>()?.gameObject;
            break;
        }
        if (currentCanvas.GetComponent <GUIControll>().GUIEnabled.Split.activeSelf)
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                currentCanvas.GetComponent <GUIControll>().GUIEnabled.Split.GetComponent <SplitPanel>().Close();
            }
        }
    }
コード例 #9
0
ファイル: MapScript.cs プロジェクト: Dakuseiba/RPG_Dungeon
 public void MissionStartEnable(ForceTravel _travel, ForceTravel.TravelEvent type)
 {
     MissionStartPanel.SetActive(true);
     MissionStartPanel.GetComponent <MissionStart>().SetPanel(_travel, type);
 }