Inheritance: MonoBehaviour
示例#1
0
    // Use this for initialization
    void Start()
    {
        trackedObj  = GetComponent <SteamVR_TrackedObject>();
        fJoint      = GetComponent <FixedJoint>();
        controller  = GetComponent <SteamVR_TrackedController>();
        levelSwitch = GetComponent <LevelSwitch>();

        controller.MenuButtonClicked += Controller_MenuButtonClicked;
        controller.PadClicked        += Controller_PadClicked;
    }
 // Start is called before the first frame update
 void Start()
 {
     if (s == null)
     {
         s = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(this.gameObject);
 }
示例#3
0
    // Use this for initialization
    void Start()
    {
        levelswitch = GameObject.FindGameObjectWithTag("LevelSwitcher").GetComponent <LevelSwitch>();
        audioSource = GetComponent <AudioSource>();

        foreach (Transform child in UImessageContainer)
        {
            UImessages.Add(child.gameObject);
        }

        StartCoroutine(UIMessageDelay());
    }
示例#4
0
 void Start()
 {
     levelswitch  = GameObject.FindGameObjectWithTag("LevelSwitcher").GetComponent <LevelSwitch>();
     anim         = GetComponent <Animator>();
     anim.enabled = false;
     StartCoroutine(BallAnimationDelay());
     //resetButtonHit = GameObject.FindGameObjectWithTag("RevGravButton").GetComponent<SceneReset>();
     collectiblesResetObject = collectiblesParent;                           // used so that when collectibles disappear this will reset them correctly
     target.GetComponentInChildren <Light>().color = Color.green;
     rb                 = GetComponent <Rigidbody>();
     rend               = GetComponent <Renderer>();
     rend.enabled       = false;
     materials          = GetComponent <Renderer>().materials;
     validMaterial      = materials[0];
     invalidMaterial    = materials[1];
     rend.material      = validMaterial;
     rb.angularVelocity = new Vector3(0, initialOmegaY, 0);
     rb.AddForce(transform.forward * impulseForce, ForceMode.Impulse);       // used for testing when not at the vive
     Physics.gravity     = new Vector3(0, -g, 0);
     collectiblesCounter = Instantiate(collectiblesParent, originalPositionCollectibles, originalRotationCollectibles);
 }