void Awake() { _instance = this; #if UNITY_ANDROID && ENABLE_PLUGIN android = new AndroidJavaObject(ObjectClassPath); android.Call("init", gameObject.name, "ScreenshotReceiveAgentEvent"); #endif }
private IEnumerator DoShare() { ScreenshotAgent.Enable(); yield return(null); // IOSSocialManager.instance.ShareMedia( shareCopy, ScreenshotAgent.GetTexture() ); }
void Awake() { if (mInstance != null) { Debug.LogError(string.Format("Only one instance of ScreenshotAgent allowed! Destroying:" + gameObject.name + ", Other:" + mInstance.gameObject.name)); return; } mInstance = this; texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false); Disable(); }
void Awake() { if( mInstance != null ) { Debug.LogError( string.Format( "Only one instance of ScreenshotAgent allowed! Destroying:" + gameObject.name +", Other:" + mInstance.gameObject.name ) ); return; } mInstance = this; adjustedWidth = Mathf.RoundToInt( Screen.height / 3f * 4f ); adjustedX = Mathf.RoundToInt( ( Screen.width - adjustedWidth ) / 2f ); texture = new Texture2D( adjustedWidth, Screen.height, TextureFormat.RGB24, false ); Disable(); }