Try the search, it's linked to some great forums

Tuesday, January 19, 2016

Unity notes

Unity is the premier 2D/3D gaming platform out there.  I've just started going through a series of tutorials from Stone River Learning.  They're very nice.

Here's code for a 'constructor'.  A constructor is when a class or struct is created, its constructor is called. Constructors have the same name as the class or struct, and they usually initialize the data members of the new object. 
and here's a code snippet;
    public struct Question
    {
        public string questionText;
        public string[] answers;
        public int correctAnswer;

// This is the constructor that initializes the Question struct/object
        public Question(string questionText, string[] answers, int correctAnswer)
        {
            this.questionText = questionText;
            this.answers = answers;
            this.correctAnswer = correctAnswer;
        }

    }
        
    public Question testQuestion = new Question ("What is your favorite color?", new string[]{"blue","green","yellow"}, 0);


Enumeration snippet;
            foreach (GameObject p in TriviaPanels) {
                p.SetActive (false);


Here's another note;
 
 

Configuring a webView, MKMapView, UIAlertView

Another quickstart guide to various views;

webView
Here the code for viewDidLoad;
    // Do any additional setup after loading the view, typically from a nib.
    NSString *fullURL = @"http://cutthroatrobotics.com/";
    NSURL *url = [NSURL URLWithString:fullURL];
    NSURLRequest *requestObj    = [NSURLRequest requestWithURL:url];
    [self.viewWeb loadRequest:requestObj];


UIAlertView
 Here's a snippet ;