示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        R        = GetComponent <MeshRenderer>();
        AngleId  = Shader.PropertyToID("_Angle");
        ScrollId = Shader.PropertyToID("_Scroll");

        SliceCount    = URLParameters.GetSearchParameters().GetInt("slicecount", SliceCount);
        ScrollSpeed   = (float)URLParameters.GetSearchParameters().GetDouble("scrollspeed", ScrollSpeed);
        RotationSpeed = (float)URLParameters.GetSearchParameters().GetDouble("rotationspeed", RotationSpeed);
        TexTiling.x   = (float)URLParameters.GetSearchParameters().GetDouble("tilingx", TexTiling.x);
        TexTiling.y   = (float)URLParameters.GetSearchParameters().GetDouble("tilingy", TexTiling.y);
        TexOffset.x   = (float)URLParameters.GetSearchParameters().GetDouble("offsetx", TexOffset.x);
        TexOffset.y   = (float)URLParameters.GetSearchParameters().GetDouble("offsety", TexOffset.y);

        if (Url != "" || URLParameters.GetSearchParameters().TryGetValue("url", out Url))
        {
            StartCoroutine(DownloadImage(UnityWebRequest.UnEscapeURL(Url)));
        }
        else
        {
            R.material = MatDefault;
        }

        if (SliceCount % 2 != 0)
        {
            ++SliceCount;       // need even slice count for uvs to match.
        }
        SliceTextureAngle = 2 * Mathf.PI / SliceCount;

        GetComponent <MeshFilter>().sharedMesh = GenerateMesh();

        MatDefault.SetTextureOffset("_MainTex", TexOffset);
        MatDefault.SetTextureScale("_MainTex", TexTiling);
    }
    //check which tutorial to use
    void CheckTutorialUrl()
    {
        // Read any parameters included in URL
        Dictionary <string, string> searchParameters = URLParameters.GetSearchParameters();

        //https://some.domain.com/index.html?parameterName=parameterValue
        if (searchParameters.ContainsKey("tutorialMode"))
        {
            string tutorialMode = searchParameters["tutorialMode"];
            if (tutorialMode == "SequenceTutorial")
            {
                AddTutorials(0);
            }
            else if (tutorialMode == "FullTutorial")
            {
                AddTutorials(1);
            }
            else if (tutorialMode == "PICTutorial")
            {
                AddTutorials(2);
            }
            else
            {
                AddTutorials(1);
            }
        }
        else
        {
            AddTutorials(1);
        }
    }
示例#3
0
    void Awake()
    {
        if (instance == null)
        {
            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                string mode;
                URLParameters.GetSearchParameters().TryGetValue("mode", out mode);
                if (mode == null)
                {
                    mode = "normal";
                }

                if (mode.ToLower() == "normal")
                {
                    gameMode = new NormalGameMode();
                }
                else if (mode.ToLower() == "hardcore")
                {
                    gameMode = new HardcoreGameMode();
                }
                else if (mode.ToLower() == "zen")
                {
                    gameMode = new ZenGameMode();
                }
            }

            instance    = this;
            board.scale = 5f / (2 * boardSize + 1);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
示例#4
0
    // Start is called before the first frame update
    void Start()
    {
        GC.TeethCount      = URLParameters.GetSearchParameters().GetInt("teethcount", GC.TeethCount);
        GC.InnerRadius     = (float)URLParameters.GetSearchParameters().GetDouble("innerradius", GC.InnerRadius);
        GC.OuterRadius     = (float)URLParameters.GetSearchParameters().GetDouble("outerradius", GC.OuterRadius);
        GC.OuterToothDepth = (float)URLParameters.GetSearchParameters().GetDouble("outertoothdepth", GC.OuterToothDepth);
        GC.InnerToothDepth = (float)URLParameters.GetSearchParameters().GetDouble("innertoothdepth", GC.InnerToothDepth);
        GC.Width           = (float)URLParameters.GetSearchParameters().GetDouble("width", GC.Width);

        GC.ForceUpdateMesh = true;
    }
示例#5
0
    // Start is called before the first frame update

    void Start()
    {
        string SceneName;

        if (URLParameters.GetSearchParameters().TryGetValue("scene", out SceneName) == false)
        {
            SceneName = DefaultSceneName;
        }

        SceneManager.LoadScene(SceneName, LoadSceneMode.Additive);
    }
示例#6
0
 /// <summary>
 /// Get an editor utils object that can be used for common Editor stuff - DO make sure to Dispose() the instance.
 /// </summary>
 /// <param name="editorObj">The class that uses the utils. Just pass in "this".</param>
 /// <param name="customUpdateMethod">(Optional) The method to be called when the GUI needs to be updated. (Repaint will always be called.)</param>
 /// <param name="customNewsURL">(Optional) Custom News URL to fetch the news messages from (will default to the News URL in app config if none provided)</param>
 /// <param name="overrideParameters">A custom set of URL Parameters to use when fetching news data. If left empty, the default set of parameters will be used</param>
 /// <returns>Editor Utils</returns>
 public static EditorUtils GetEditorUtils(IPWEditor editorObj, System.Action customUpdateMethod = null, string customNewsURL = null, URLParameters overrideParameters = null)
 {
     return new EditorUtils(CONF, editorObj, null, customUpdateMethod, customNewsURL, overrideParameters);
 }