Exemple #1
0
    private HUDListEntry LoadHUDListEntry()
    {
        GameObject   o     = GameObject.Instantiate(Resources.Load("HUDListEntry")) as GameObject;
        HUDListEntry entry = o.GetComponent <HUDListEntry>();

        o.transform.parent           = ObjEntryAnchor.transform;
        o.transform.localPosition    = Vector3.zero;
        o.transform.localEulerAngles = Vector3.zero;
        o.transform.localScale       = new Vector3(1, 1, 1);
        entry.SetAlpha(0);
        return(entry);
    }
Exemple #2
0
    public override void Initialize()
    {
        base.Initialize();

        GameEventHandler.OnShipDeath -= OnShipDeath;
        GameEventHandler.OnShipDeath += OnShipDeath;

        _unselectedShips          = new Dictionary <ShipBase, UISprite>();
        _unselectedShipsOffScreen = new Dictionary <ShipBase, UISprite>();
        _allEntries    = new List <HUDListEntry>();
        _weaponEntries = new List <HUDWeaponEntry>();
        _fastWarnings  = new List <UISprite>();
        for (int i = 0; i < 13; i++)
        {
            HUDListEntry entry = LoadHUDListEntry();
            entry.transform.localPosition = new Vector3((Mathf.Sqrt(1f - Mathf.Pow(Mathf.Abs(6f - i) / 6f, 2)) * 9f), i * 32f, 0);
            _allEntries.Add(entry);
        }
        ClearTargetData();

        LoadWeaponEntries();
    }