Esempio n. 1
0
    // Use this for initialization (overrides the other start methods so is always called even by parent method calls)
    protected override void Start()
    {
        foreach (var part in partsToDestroy)
        {
            Destroy(part.gameObject);
        }
        partsToDestroy.Clear();

        base.Start();

        if (hud)
        {
            hud.InitializeHUD(this);
        }
        else
        {
            Camera.main.GetComponent <CameraScript>().Initialize(this);
            GameObject.Find("AbilityUI").GetComponent <AbilityHandler>().Initialize(this);
        } // initialize the HUD
        if (!loaded)
        {
            LoadSave(cursave);
            loaded = true;
        }

        // force sectors to load once positioning has been determined
        SectorManager.instance.AttemptSectorLoad();

        // the player needs a predictable name for task interactions, so its object will always be called this
        name = entityName = "player";
    }