Ejemplo n.º 1
0
    void SetMission()
    {
        //Select Mission
        indexOfMission = UnityEngine.Random.Range(0, missionData.Count - 3);
        mission        = new Missions(missionData[indexOfMission]);

        //Find MissionObject & Initiallize
        int cnt1 = mission.GetMissionCount();

        missionObjects = new MissionObject[cnt1][];
        for (int i = 0; i < cnt1; i++)
        {
            int cnt2 = mission.GetDuplicateObjectsCount(i);
            missionObjects[i] = new MissionObject[cnt2];

            Vector3 playerPos = mission.GetStartPosition();
            if (i != 0)
            {
                playerPos = missionObjects[i - 1][0].GetSD();
            }
            for (int j = 0; j < cnt2; j++)
            {
                missionObjects[i][j] = new MissionObject(objectData, mission.GetObjectIndex(i, j), playerPos);
            }
        }

        mission.SetMissionPosition(missionObjects);
        for (int i = 0; i < missionObjects.Length; i++)
        {
            //Debug.Log(missionObjects[i].GetName());
        }
    }