//--------------------------------------
		//  Methods
		//--------------------------------------		
		///<summary>
		///	Use this for initialization
		///</summary>
		void Start () 
		{
			
			// MAKE AN INSTANCE AND TEST IT.
			templateComponent = GetComponents<TemplateComponent>()[0];
				
			// VARIABLES......
			
			// PUBLIC
			templateComponent.samplePublic_str = "test1";
			
			// GETTER / SETTER
			templateComponent.samplePublic2 = "test2";
			Debug.Log("samplePublic2: " + templateComponent.samplePublic2);
				
			// PUBLIC STATIC
			TemplateComponent.SamplePublicStatic_str = "test3";
			
			// METHODS......
			
			// PUBLIC
			templateComponent.samplePublicMethod("test4");
				
			// PUBLIC STATIC
			TemplateComponent.SamplePublicStaticMethod("test5");
			
				
		}
Exemple #2
0
        //--------------------------------------
        //  Methods
        //--------------------------------------
        ///<summary>
        ///	Use this for initialization
        ///</summary>
        void Start()
        {
            // MAKE AN INSTANCE AND TEST IT.
            templateComponent = GetComponents <TemplateComponent>()[0];

            // VARIABLES......

            // PUBLIC
            templateComponent.samplePublic_str = "test1";

            // GETTER / SETTER
            templateComponent.samplePublic2 = "test2";
            Debug.Log("samplePublic2: " + templateComponent.samplePublic2);

            // PUBLIC STATIC
            TemplateComponent.SamplePublicStatic_str = "test3";

            // METHODS......

            // PUBLIC
            templateComponent.samplePublicMethod("test4");

            // PUBLIC STATIC
            TemplateComponent.SamplePublicStaticMethod("test5");
        }
        //--------------------------------------
        //  Methods
        //--------------------------------------
        ///<summary>
        ///	Use this for initialization
        ///</summary>
        void Start()
        {
            // TEST PRIVATE
            samplePrivateMethod("test6");

            // TEST PRIVATE STATIC
            TemplateComponent.SamplePrivateStaticMethod("test7");

            // TEST EVENT HANDLER (SEND MESSAGE TO ITSELF AS A SILLY TEST)
            gameObject.SendMessage("onSampleEvent", "test8", SendMessageOptions.RequireReceiver);

            // COROUTINE
            StartCoroutine("_samplePrivateCoroutine", "test9");

            // INVOKE
            //Invoke ("_sampleInvokeMethod", 10f);
            InvokeRepeating("_sampleInvokeMethod", 1, 10);
        }