void spawnResource() { GameObject obj = Instantiate(m_resource_prefab, Vector3Calc.randomDirection() * 8f, Quaternion.identity); obj.GetComponent <Resource>().Initalize(RandomCalc.Rand(new Range <float>(10f, 100f))); ObjectLogger.log(obj, "RESOURCE"); }