Exemplo n.º 1
0
    protected void BreakerStart()
    {
        // Reach for important components in this game object
        fpsSelection  = GameObject.Find("FPS").GetComponent <DetectSelection>();
        audioSource   = transform.Find("Body/Sound").gameObject.GetComponent <AudioSource>();
        armWrapper    = transform.Find("Body/ArmWrapper");
        timeClicked   = Mathf.Infinity;
        roundedBoxMat = transform.Find("Body/RoundedBoxWrapper/RoundedBox").GetComponent <Renderer>().material;
        isHighlighted = false;

        // Collider objects must be renamed for the DetectSelection script
        colliderName = gameObject.name + ": collider <generated by script>";
        transform.Find("Body/RoundedBoxWrapper/RoundedBox").gameObject.name = colliderName;
        // Starting position for the breaker
        if (isOpened)
        {
            OpenBreaker();
            OpenSpecific();
        }
        else
        {
            CloseBreaker();
            CloseSpecific();
        }
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     // Extract Light components from provided Light transforms
     foreach (Transform lightTransform in lightTransforms)
     {
         Light light = lightTransform.Find("Light").gameObject.GetComponent <Light>();
         associatedLights.Add(light);
     }
     // Reach for important components in this game object
     audioStart    = transform.Find("Body/SoundStart").gameObject.GetComponent <AudioSource>();
     audioDuring   = transform.Find("Body/SoundDuring").gameObject.GetComponent <AudioSource>();
     fpsSelection  = GameObject.Find("FPS").GetComponent <DetectSelection>();
     knob          = transform.Find("Body/ArmWrapper");
     roundedBoxMat = transform.Find("Body/RoundedBoxWrapper/RoundedBox").GetComponent <Renderer>().material;
     isHighlighted = false;
     // Collider objects must be renamed for the DetectSelection script
     colliderName = gameObject.name + ": collider <generated by script>";
     transform.Find("Body/RoundedBoxWrapper/RoundedBox").gameObject.name = colliderName;
     // Start the timer or not
     if (isOpened)
     {
         Open();
     }
     else
     {
         Close();
     }
 }