Пример #1
0
 void Awake()
 {
     clueItemInspector = ClueItemInspector.S;
     clueManager       = ClueManager.S;
     nameText          = clueItemInspector.clueListInspectorName;
     descriptionText   = clueItemInspector.clueListInspectorDescription;
     clueImageDisplay  = clueItemInspector.clueImageDisplay;
     clueIconSprite    = Resources.Load("Sprites\\" + clueInfo.clueName, typeof(Sprite)) as Sprite;
 }
    GameObject inspectionLight   = null; // cache, so we can destroy and recreate it as needed

    // methods

    void Awake()
    {
        S = this;
        // better to set up component refs in Awake, since it executes before Start
        mainCam = Camera.main;
        //DontDestroyOnLoad (mainCam);

        voidCamControl = mainCam.GetComponent <CameraController>();

        _clueLayer = 1 << LayerMask.NameToLayer("Clue");


        //Attempt to find UI Text by name if not plugged in already
        if (itemNameDisplay == null)
        {
            itemNameDisplay = GameObject.Find("ItemName").GetComponent <Text>();
        }

        if (itemDescripDisplay == null)
        {
            itemDescripDisplay = GameObject.Find("ItemDescription").GetComponent <Text>();
        }
    }