示例#1
0
 // Use this for initialization
 private void Start()
 {
     if (!gameObject.GetComponent("DataRockets"))
     {
         currentRocket = gameObject.AddComponent("DataRockets") as DataRockets;
     }
     else if (currentRocket == null)
     {
         currentRocket = gameObject.AddComponent("DataRockets") as DataRockets;
     }
     else
     {
         currentRocket = gameObject.GetComponent("DataRockets") as DataRockets;
     }
     currentRocket.CurrentRocket = RocketCaliber;
 }
示例#2
0
	// Use this for initialization
	private void Start () 
	{
		if(!gameObject.GetComponent("DataRockets"))
		{
			currentRocket = gameObject.AddComponent("DataRockets") as DataRockets;
		}
		else if(currentRocket == null)
		{
			currentRocket = gameObject.AddComponent("DataRockets") as DataRockets;
		}
		else
		{
			currentRocket = gameObject.GetComponent("DataRockets") as DataRockets;
		}
		currentRocket.CurrentRocket = RocketCaliber;
	}
示例#3
0
    private void SetAmmoData()
    {
        fireShellData.Shell      = shell.rigidbody;
        fireShellData.SpawnPoint = GameObject.Find(user + "ShellSpawnPoint");
        fireShellData.isAlive    = true;
        fireShellData.smoke      = gunSmoke;

        hatchControlData               = hatchControl.AddComponent("DataHatchControl") as DataHatchControl;
        hatchControlData.Power         = 30;
        hatchControlData.RocketCaliber = rocketCaliber;

        shellData = shell.AddComponent("DataShells") as DataShells;
        shellData.CurrentShell = shellCaliber;
        shellData.Reload();

        rocketData = rocket.AddComponent("DataRockets") as DataRockets;
        rocketData.CurrentRocket = hatchControlData.RocketCaliber;
        rocketData.Reload();
    }
示例#4
0
	private void SetAmmoData()
	{
		fireShellData.Shell = shell.rigidbody;
		fireShellData.SpawnPoint = GameObject.Find (user+"ShellSpawnPoint");
		fireShellData.isAlive = true;
		fireShellData.smoke = gunSmoke;
		
		hatchControlData = hatchControl.AddComponent("DataHatchControl") as DataHatchControl;
		hatchControlData.Power = 30;
		hatchControlData.RocketCaliber = rocketCaliber;
		
		shellData = shell.AddComponent("DataShells") as DataShells;
		shellData.CurrentShell = shellCaliber;
		shellData.Reload();
		
		rocketData = rocket.AddComponent("DataRockets") as DataRockets;
		rocketData.CurrentRocket = hatchControlData.RocketCaliber;
		rocketData.Reload();
	}