private ITempNetObject CreateLocalNetObject(int prefabID, TempObjID tempObjID, Vector3 pos, Quaternion rot)
    {
        // verify prefab id
        if (prefabID < 0 || prefabID >= prefabs.Length)
        {
            GameLog.Err("invalid prefab id for temp object");
            // log an error
            return(null);
        }
        GameObject obj = null;

        if (NetworkCore.isServer)
        {
            obj = Instantiate(prefabs[prefabID].serverPrefab, pos, rot);
        }
        else if (NetworkCore.isClient)
        {
            obj = Instantiate(prefabs[prefabID].clientPrefab, pos, rot);
        }

        if (obj == null)
        {
            GameLog.Err("instantiated temp object is null!");
            return(null);
        }

        ITempNetObject tempObj = obj.GetComponent <ITempNetObject>();

        tempObj.SetID(tempObjID);
        return(tempObj);
    }
 private void RemoveLocalNetObject(TempObjID objID)
 {
     // lookup the object
     if (mapping.ContainsKey(objID))
     {
         ITempNetObject obj = mapping[objID];
         obj.ObjectRemoved();
         mapping.Remove(objID);
     }
     else
     {
         GameLog.Err("Can't remove temp object.");
     }
 }