Exemplo n.º 1
0
    /// <summary>
    /// Setups the scene from the editor and popups warning if some
    /// configuration problem is found.
    /// </summary>
    /// <param name="controlCenter">Control center.</param>
    static void SetupAWConfig(GameObject controlCenter)
    {
        AWConfig config = controlCenter.GetComponent <AWConfig>();

        config.netSystem = netSystem;
        config.arSystem  = arSystem;
        if (netSystem == NetSystem.HLAPI)
        {
            AWNetworkManager netManager = controlCenter.GetComponent <AWNetworkManager>();
            if (netManager == null)
            {
                Debug.LogWarning("Networking system setted to HLAPI, " +
                                 "but no AWNetworkManager found on AWControlCenter");
            }
        }
        if (arSystem == ARSystem.Vuforia)
        {
            GameObject arCameraGO = GameObject.Find("ARCamera");
            if (arCameraGO == null || !arCameraGO.activeInHierarchy)
            {
                Debug.LogWarning("ARCamera for Vuforia not found or inactive, " +
                                 " remember to configure it properly.");
            }
            else
            {
                VuforiaBehaviour vb = arCameraGO.GetComponent <VuforiaBehaviour>();
                if (vb.AppLicenseKey.Length < 2)
                {
                    Debug.LogWarning("Is the VuforiaBehaviour License Key setted correctly?");
                }
            }
        }
    }
Exemplo n.º 2
0
 public static AWNetworkManager GetInstance()
 {
     if (instance == null)
     {
         instance = GameObject.Find(AWConfig.AW_CONFIG_GO_NAME)
                    .GetComponent <AWNetworkManager>();
     }
     return(instance);
 }
Exemplo n.º 3
0
    // Init
    void Start()
    {
        if (networkManager == null)
        {
            string goName = AWConfig.AW_CONFIG_GO_NAME;
            networkManager = GameObject.Find(goName).GetComponent <AWNetworkManager>();
        }

        logger = ScreenLogger.getLogger();
        initEvents();
    }
Exemplo n.º 4
0
    //AskCurrentState handling

    public override void OnStartClient()
    {
        base.OnStartClient();
        NetworkClient client = AWNetworkManager.GetInstance().client;

        if (client != null)
        {
            client.RegisterHandler(GetAskCSMsgId(),
                                   OnCurrentStateReceived);
        }
        else
        {
            Debug.LogWarning("AWNetworkManager returned null client");
        }
    }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     logger     = ScreenLogger.getLogger();
     netManager = (AWNetworkManager)AWNetworkManager.singleton;
 }