Quantcast
Channel: Forum Pasja Informatyki - Najnowsze pytania bez odpowiedzi
Viewing all articles
Browse latest Browse all 22083

Nie mogę zmienić zmiennej w innym skrypcie

$
0
0
//SKRYPT A
/************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DronePowerControl : MonoBehaviour
{
	public static GameObject Motor;

	private Engine motor = Motor.GetComponent<Engine> ();

	void Update () {

		motor.speed += 1f;
	}
}
/**************/
//SKRYPT B
/**************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Engine : MonoBehaviour
{
	public float speed = 2000f;
}
/**************/

Jak ze skryptu A mogę zmienić zmienną "speed" w skrypcie B?


Viewing all articles
Browse latest Browse all 22083