Пример #1
0
    void Start()
    {
        if (singleton != null)
        {
            Debug.LogWarning("HudConfiguration: Multiple instance detected. Destroying...");
            Destroy(gameObject);
        }
        else
        {
            singleton = this;
            //keep through level change
            DontDestroyOnLoad(gameObject);

            m_viewportConfig = new List <HudProperties[]>();
            m_views          = new Dictionary <GameObject, GameObject>();
            m_defaultCam     = GameObject.Find("Main Camera");
            //viewportConfig.Add (viewportNetwork);
            m_viewportConfig.Add(viewportSingle);
            m_viewportConfig.Add(viewportDual);
            m_viewportConfig.Add(viewportTriple);
            m_viewportConfig.Add(viewportQuad);
        }
    }
 void OnDestroy()
 {
     //if any hud was connected, destroy it
     HudConfiguration.DestroyHud(gameObject);
 }
 public override void OnStartLocalPlayer()
 {
     HudConfiguration.CreateHud(gameObject);
     gameObject.name += " (Owner)";
 }