コード例 #1
0
 private void Awake()
 {
     // Check to see if there is an instance
     if (!instance)
     {
         instance = this; // If not set to this
     }
     else
     {
         Destroy(this.gameObject); // Otherwise destroy this
     }
 }
コード例 #2
0
        /// <summary>
        /// Set up references and variables
        /// </summary>
        void OnEnable()
        {
            // Get a reference to the target
            captureTool = (ScreenCaptureTool)target;

            // Get all of the properties from the target class
            // Settings
            fileName = serializedObject.FindProperty("fileName");
            upscale  = serializedObject.FindProperty("upScale");

            // Advanced Settings
            useTime  = serializedObject.FindProperty("useTime");
            fileType = serializedObject.FindProperty("fileType");
        }