Beispiel #1
0
    //construct a single module
    void constructModule(Pos pos, modType kind)
    {
        GameObject mod = null;

        if (kind == modType.NUCLEUS)
        {
            mod = GameObject.Instantiate(nucleus);
        }
        else if (kind == modType.BLUERES)
        {
            mod = GameObject.Instantiate(blueres);
        }
        else if (kind == modType.REDRES)
        {
            mod = GameObject.Instantiate(redres);
        }
        else if (kind == modType.FEEDER)
        {
            mod = GameObject.Instantiate(feeder);
        }
        else if (kind == modType.THRUSTER)
        {
            mod = GameObject.Instantiate(thruster);
        }

        mod.transform.position = new Vector3(pos.x + startpos.x, pos.y + startpos.y, 0);
        Module comp = mod.GetComponent <Module>();

        comp.mine            = this;
        mod.transform.parent = this.transform;

        //add to list
        modules.Add(pos, mod);
    }
 public Modifiers(modType t, AbstractNode sib)
 {
     mod = t;
     this.makeSibling(sib);
 }
 public Modifiers(modType t)
 {
     mod = t;
 }