示例#1
0
    public void Start()
    {
        if (PlayerController.Instance != null && GameManager.instance != null)
        {
            PlayerController.Instance.gameObject.SetActive(false);
            PopulateSlots(PlayerController.Instance.monster, GameManager.instance.gameFile.player.name);
        }

        if (GameManager.instance != null)
        {
            collectedParts   = GameManager.instance.gameFile.player.inventory.collectedParts;
            collectedWeapons = GameManager.instance.gameFile.player.inventory.collectedWeapons;
        }
        else
        {
            collectedParts = new CollectedPartsInfo()
            {
                collectedHeads = new List <string>()
                {
                    "Mitch"
                },
                collectedTorsos = new List <string>()
                {
                    "Mitch"
                },
                collectedRightArms = new List <string>()
                {
                    "Mitch"
                },
                collectedLeftArms = new List <string>()
                {
                    "Mitch"
                },
                collectedLegs = new List <string>()
                {
                    "Mitch"
                }
            };
            collectedWeapons = new List <string>()
            {
                "Stick", "Pea Shooter"
            };
        }
    }
示例#2
0
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Instance       = this;
         collectedParts = new CollectedPartsInfo();
         collectedParts.collectedHeads     = new List <string>();
         collectedParts.collectedTorsos    = new List <string>();
         collectedParts.collectedLeftArms  = new List <string>();
         collectedParts.collectedRightArms = new List <string>();
         collectedParts.collectedLegs      = new List <string>();
         collectedWeapons = new List <string>();
         LoadInventory();
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }