Ejemplo n.º 1
0
    //
    // API
    //


    //
    // Utility
    //

    // Bike Factory stuff

    static public GameObject CreateBike(IBike ib, FeGround feGround)
    {
        GameObject newBike = GameObject.Instantiate(FrontendBikeFactory.GetInstance().bikePrefab, utils.Vec3(ib.basePosition), Quaternion.identity) as GameObject;

        newBike.AddComponent(bikeClassTypes[ib.ctrlType]);
        newBike.transform.parent = feGround.transform;
        FrontendBike bk = (FrontendBike)newBike.transform.GetComponent("FrontendBike");

        bk.Setup(ib, BeamMain.GetInstance().beamApp.mainGameInst);
        return(newBike);
    }
Ejemplo n.º 2
0
    public void RemoveBike(GameObject bikeObj)
    {
        FrontendBike remBike = bikeObj.GetComponent <FrontendBike>();
        GameObject   line    = OtherPlayerLines.Find(l => (l.GetComponent <ScoreboardLine>()).bike == remBike);

        if (line != null)
        {
            OtherPlayerLines.Remove(line);
            _isDirty = true; // needs sorting
            Object.Destroy(line);
        }
    }
Ejemplo n.º 3
0
 public void SetBike(FrontendBike b)
 {
     bike              = b;
     whoTextMesh.text  = (bike.isLocal ? "" : "*") + bike.bb.name;
     whoTextMesh.color = utils.hexToColor(b.bb.team.Color);
 }