Example #1
0
 private void OnSelectedOutline(SelectedOutlineArgs args)
 {
     switch (args.OutlineObject.name)
     {
     case "Start Image":
         SceneManager.LoadScene("Scenes/Game", LoadSceneMode.Single);
         break;
     }
 }
Example #2
0
    private void OnSelectedOutline(SelectedOutlineArgs args)
    {
        Transform crateEmpty = args.OutlineObject.transform.parent;

        crateEmpty.parent = gameObject.transform;
        crateEmpty.GetComponent <BoxCollider>().isTrigger = true;
        Rigidbody rb = crateEmpty.GetComponent <Rigidbody>();

        rb.useGravity  = false;
        rb.isKinematic = true;
        manager.shouldObserveOutlines = false;

        // Play game sound
        if (playOnAttach != null)
        {
            GetComponent <AudioSource>().PlayOneShot(playOnAttach);
        }
    }