This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| using UnityEditor; | |
| public class LevelEditorWindow : EditorWindow { | |
| Texture levelData; | |
| int previewSize = 500; | |
| int topMargin = 50; | |
| Color activeColor = Color.white; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using (AndroidJavaClass unity_player = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) | |
| { | |
| AndroidJavaObject current_activity = unity_player.GetStatic<AndroidJavaObject>("currentActivity"); | |
| string obb_package = current_activity.Call<string>("getPackageName"); | |
| bool isAZConsole = current_activity.Call<AndroidJavaObject>("getPackageManager").Call<bool>("hasSystemFeature", "android.hardware.type.television"); | |
| if(isAZConsole) { | |
| // On AZ console | |
| dfapp.isConsole = true; | |
| } | |
| else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using (AndroidJavaClass unity_player = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) | |
| { | |
| AndroidJavaObject current_activity = unity_player.GetStatic<AndroidJavaObject>("currentActivity"); | |
| string obb_package = current_activity.Call<string>("getPackageName"); | |
| bool isAZConsole = current_activity.Call<AndroidJavaObject>("getPackageManager").Call<bool>("hasSystemFeature", "android.hardware.type.television"); | |
| if(isAZConsole) { | |
| Debug.Log("java says console"); | |
| dfapp.isConsole = true; | |
| } | |
| else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| using System.Timers; | |
| public class JQTimer { | |
| public bool running = true; | |
| System.Action action; | |
| Timer timer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The Idea Phase | |
| While the rest of this book focuses primarily on the distribution and development of apps, in this chapter we’ll take a quick detour and discuss the idea phase. While coming up with something completely new is not impossible, it’s very difficult. So it’s important to first understand a few points about the app market, and product development in general. | |
| Competition is good | |
| Let’s say you have idea for your next great app. Photo filters for pets, it’ll be awesome! While you’re thinking about this idea, figuring out what’s going to work best in terms of ease of use, marketability, and engineering, you might also take a quick stop to the app store to look for existing products. What do you see? Uh-oh, there are hundreds of results in the search, almost none of them have any reviews or ratings. With so many competitors, and so many of them not succeeding, what chance does your app have, you may be thinking. | |
| Let me tell you why this is the wrong way to think about competition. In 1997 AOL released |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Called when a button is clicked. The view will be automatically dismissed after this call returns | |
| - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex; | |
| // Called when we cancel a view (eg. the user clicks the Home button). This is not called when the user clicks the cancel button. | |
| // If not defined in the delegate, we simulate a click in the cancel button | |
| - (void)actionSheetCancel:(UIActionSheet *)actionSheet; | |
| - (void)willPresentActionSheet:(UIActionSheet *)actionSheet; // before animation and showing view | |
| - (void)didPresentActionSheet:(UIActionSheet *)actionSheet; // after animation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Command | |
| attr_accessor :name, :response, :needs_arg | |
| def initialize args | |
| needs_arg = false # Default | |
| args.each do |k,v| | |
| instance_variable_set("@#{k}", v) unless v.nil? | |
| end | |
| puts 'Command added: '+name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Level 1: | |
| Endless-runner like with open area at end | |
| Level 2: | |
| I drifted deeper in to sleep. | |
| Green background, tree lines. | |
| Level 3: | |
| The dream world grew more abstract and strange. | |
| Floating beds, trees, colorful background. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void SpawnVehicles() { | |
| // Spawn between 3 and 6 vehicles | |
| float carWidth = 10.0f; | |
| for(int i=0;i<Random.Range(3,6);i++) { | |
| Vector3 vPos = playerTransform.position; | |
| vPos += (40.0f*i+40.0f)*Vector3.forward; | |
| //float laneStartX = xStart; | |
| float rx = Random.Range(xStart + carWidth, xStart+levelWidth - carWidth); | |
| GameObject vehicle = (GameObject)Instantiate(vehiclePrefab, vPos, Quaternion.Euler(0,180,0)); | |
| Runner tRunner = vehicle.GetComponent<Runner>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| public class Checkpoint : MonoBehaviour { | |
| void OnTriggerEnter2D(Collider2D col) | |
| { | |
| Player p = col.GetComponent<Player>(); | |
| if( p != null) { | |
| // Player touched pickup |