Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (s == null)
        {
            s = this;
        }


        else
        {
            Debug.LogError("Hero.Awake() - Attempted to assign second Hero.s");
        }

        ClearWeapons();
        weapons[0].SetType(WeaponType.blaster);

        //fireDelegate += TempFire;
        bndCheck      = GetComponent <boundsScript>();
        HeroRigidbody = GetComponent <Rigidbody>();
        speedHolder   = speed;

        materials     = Utils.GetAllMaterials(gameObject);
        orignalColors = new Color[materials.Length];

        for (int i = 0; i < materials.Length; i++)
        {
            orignalColors[i] = materials[i].color;
        }

        print(invincibillityDuration);
    }
Пример #2
0
    private void Awake()
    {
        //speed = 10f;
        bndCheck = GetComponent <boundsScript>();
        // score = GetComponent<ScoreScript>().UpdateScore();

        materials     = Utils.GetAllMaterials(gameObject);
        orignalColors = new Color[materials.Length];

        for (int i = 0; i < materials.Length; i++)
        {
            orignalColors[i] = materials[i].color;
        }
    }
Пример #3
0
    // Start is called before the first frame update
    void Awake()
    {
        s        = this;
        bndCheck = GetComponent <boundsScript>();
        //scoreInt = GetComponent<ScoreScript>();

        Invoke("SpawnEnemy", 1f / enemySpawnPerSecond);

        WEAP_DICT = new Dictionary <WeaponType, WeaponDefinition>();
        foreach (WeaponDefinition def in weaponDefinitions)
        {
            WEAP_DICT[def.type] = def;
        }
    }
Пример #4
0
    // Start is called before the first frame update
    void Awake()
    {
        cube     = transform.Find("Cube").gameObject;
        letter   = GetComponent <TextMesh>();
        rigid    = GetComponent <Rigidbody>();
        bndCheck = GetComponent <boundsScript>();
        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;
    }
Пример #5
0
 // Start is called before the first frame update
 void Awake()
 {
     bndCheck = GetComponent <boundsScript>();
     rend     = GetComponent <Renderer>();
     rigid    = GetComponent <Rigidbody>();
 }