void Awake() { bndCheck = GetComponent <SM_BoundsCheck>(); materials = Utils.GetAllMaterials(gameObject); originalColors = new Color[materials.Length]; for (int i = 0; i < materials.Length; i++) { originalColors [i] = materials [i].color; } }
void Awake() { S = this; bndCheck = GetComponent <SM_BoundsCheck>(); Invoke("SpawnEnemy", 1f / enemySpawnPerSecond); WEAP_DICT = new Dictionary <WeaponType, WeaponDefinition>(); foreach (WeaponDefinition def in weaponDefinitions) { WEAP_DICT[def.type] = def; } }
// Use this for initialization void Awake() { cube = transform.Find("Cube").gameObject; letter = GetComponent <TextMesh> (); rigid = GetComponent <Rigidbody> (); bndCheck = GetComponent <SM_BoundsCheck> (); cubeRend = cube.GetComponent <Renderer> (); Vector3 vel = Random.onUnitSphere; vel.z = 0; vel.Normalize(); vel *= Random.Range(driftMinMax.x, driftMinMax.y); rigid.velocity = vel; transform.rotation = Quaternion.identity; rotPerSecond = new Vector3(Random.Range(rotMinMax.x, rotMinMax.y), Random.Range(rotMinMax.x, rotMinMax.y), Random.Range(rotMinMax.x, rotMinMax.y)); birthTime = Time.time; }
void Awake() { bndCheck = GetComponent <SM_BoundsCheck>(); rend = GetComponent <Renderer>(); rigid = GetComponent <Rigidbody>(); }