示例#1
0
    public void ToggleObjectActive()
    {
        ObjectToToggle.SetActive(!ObjectToToggle.activeSelf);

        gameObject.GetComponent <Button>().interactable = false;
        Blackground.color = Color.gray;

        if (HaveSound)
        {
            MySoundBoard.PlayCertainClip(2);
        }

        if (UIToToggle != null)
        {
            UIToToggle.SetActive(!UIToToggle.activeSelf);
        }

        if (MySceneController.AllowNextOnCacheCase)        // && !ObjectToToggle.activeSelf)
        {
            MySceneController.TriggerCheckEvent();

            MySceneController.AllowNextOnCacheCase = false;
            Capi.set("System.AllowNextOnCacheCase", false);
        }

        StartCoroutine(DelayNextClick());

        //ToggleButton = ObjectToToggle.activeSelf;

        Capi.set("UI." + CAPIName + "Toggle", ToggleButton);
    }
示例#2
0
    public void ToggleShownCoins()
    {
        ToggleOn.SetActive(true);

        foreach (GameObject _go in Buttons)
        {
            if (_go == gameObject)
            {
                _go.GetComponent <Image>().color = ActiveColor;
            }
            else
            {
                _go.GetComponent <Image>().color = NotActiveColor;
            }
        }

        ActiveIndicator.transform.position = new Vector3(ActiveIndicator.transform.position.x, transform.position.y, ActiveIndicator.transform.position.z);

        MySoundBoard.PlayCertainClip(2);

        DisplayedCoinsLabel.text = LabelToUse;

        foreach (GameObject _go in ToggleOff)
        {
            if (_go.activeSelf == true)
            {
                _go.SetActive(false);
            }
        }
    }
示例#3
0
    public void OpenLinkWindow()
    {
        //Application.ExternalCall("OpenExternalAsset", MyURL, WindowWidth, WindowHeight);

        string _size = "width=" + WindowWidth.ToString() + ", height=" + WindowHeight.ToString();

        //Debug.Log(_size);

        if (HaveSound)
        {
            MySoundBoard.PlayCertainClip(SoundClipIndex);
        }
        #if !UNITY_EDITOR
        OpenWebPage(MyURL, "SWV Asset", _size);
        #endif
    }
示例#4
0
    public void CreateOrbitalPath()
    {
        //First, check to see if the path object already exists.
        if (OrbitalPathsParent.transform.Find(gameObject.transform.parent.name + " Orbital Path") != null)
        {
            Debug.Log("Orbital path already exists for " + gameObject.transform.parent.name);
            // do nothing, derp derp derp
        }
        else
        {
            GameObject MyOrbitalPath = Instantiate(OrbitalPathPrefab);
            MyOrbitalPath.transform.parent = OrbitalPathsParent.transform;
            MyOrbitalPath.name             = gameObject.transform.parent.name + " Orbital Path";

            OrbitalPathRenderer _MyOPR = MyOrbitalPath.GetComponent <OrbitalPathRenderer>();

            // Exposes CAPI
            _MyOPR.FirstUpdate = true;

            // Sets line graphics. Currently only circles are supported
            MyOrbitalPath.GetComponent <LineRenderer>().SetColors(OrbitalPathStartColor, OrbitalPathEndColor);
            _MyOPR.xradius = transform.parent.GetComponent <OrbitalMovement>().radius;
            _MyOPR.yradius = _MyOPR.xradius;
            MyOrbitalPath.transform.position = transform.parent.GetComponent <OrbitalMovement>().PlanarOffset;
            //_MyOPR.UpdateLineSize = true;

            if (transform.parent.GetComponent <OrbitalMovement>().MyObjectType == SmallWorldType.Planet && (transform.parent.GetChild(2).gameObject.activeSelf == false))
            {
                Transform _namePlate = transform.parent.GetChild(2);
                _namePlate.gameObject.SetActive(true);
            }

            _SceneControllerRef.MinimapCamera.GetComponent <Zoomer>().FirstUpdate = true;

            // Tracks target
            _MyOPR.MyTarget         = transform.parent;
            _MyOPR.OrientSelf       = true;
            _MyOPR.MySmallWorldType = transform.parent.GetComponent <OrbitalMovement>().MyObjectType;

            // Add this to our short list for orbital line tracking IF you're not a planet
            if (transform.parent.parent.name != "Planet Objects")
            {
                _SceneControllerRef.LocatedSmallWorldsList.Add(MyOrbitalPath);
            }

            //Debug.Log(transform.parent.name + " | " + transform.parent.GetSiblingIndex());

            MySoundBoard.PlayCertainClip(7);
        }
    }
示例#5
0
    public void TriggerNextEvent()
    {
        if (AllowClicks)
        {
            AllowClicks = false;
            StartCoroutine(TimeOutUserClicks());

            if (HaveSound)
            {
                MySoundBoard.PlayCertainClip(2);
            }

            _MySceneController.TriggerCheckEventNOW();
        }
    }
示例#6
0
    public void TriggerNextEvent()
    {
        if (AllowClicks)
        {
            AllowClicks = false;
            StartCoroutine(TimeOutUserClicks());

            if (HaveSound)
            {
                MySoundBoard.PlayCertainClip(2);
            }

            _MySceneController.TriggerCheckEvent();
        }
        else
        {
            UserIsMashingNext = true;
            Debug.Log("User is mashing next");
            StartCoroutine(TimeOutUserClicks());
        }
    }
示例#7
0
 // This function is structured in this manner because different assessments may need different arguments/initializationss going forward.
 // In the current (10/7/2016) incarnation, this structure will look awkward. It is intentional.
 // JOS: 10/7/2016
 public void VerifyDistance()
 {
     PerformAssessment(AssessmentMode);
     MySoundBoard.PlayCertainClip(SoundClip);
 }