Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
    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;
        }
    }
Exemplo n.º 3
0
    // 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;
    }
Exemplo n.º 4
0
 void Awake()
 {
     bndCheck = GetComponent <SM_BoundsCheck>();
     rend     = GetComponent <Renderer>();
     rigid    = GetComponent <Rigidbody>();
 }