コード例 #1
0
    private void OnClothesButtonClick()
    {
        ClearViewPort(_viewPort);

        ClothesHolder clothesHolder = (ClothesHolder)_goodsHolders["Clothes"];

        Clothes[] clothes = (Clothes[])clothesHolder.GetGoodsList();
        GenerateClothesViews(clothes, _viewPort);
    }
コード例 #2
0
    public Dictionary <int, List <List <Sprite> > > dictTypeList = new Dictionary <int, List <List <Sprite> > >(); //All Clothing

    void Awake()
    {
        mainClothesHolder = this.gameObject.GetComponent <ClothesHolder>();
        if (mainClothesHolder == null)//Make main gameObject
        {
            mainClothesHolder = this.gameObject.AddComponent <ClothesHolder>();
        }
        else if (this != mainClothesHolder)
        {
            Destroy(this);
        }
    }
コード例 #3
0
    public void Init()
    {
        //Get References
        cClothesHolderReference = Game.Instance.cClothes;
        ClothingGameObjects     = this.GetComponent <PlayerSpritesHolder>();
        if (ClothingGameObjects == null)
        {
            Debug.Log("***WARNING*** ClothesHolder: Start: ClothingGameObjects is null and it shouldnt be...");
        }

        //Get Data
        //Debug.Log("ClothesController: Start: cClothesHolderReference.dictTypeList: " + cClothesHolderReference.dictTypeList.Count);
        dictTypeList = cClothesHolderReference.dictTypeList;

        //Set Instance Data
        dictPlayerSprites[ClothesHolder.HATS_INDEX] = ClothingGameObjects.HAT_GAMEOBJECT.GetComponent <SpriteRenderer>();

        dictPlayerSprites[ClothesHolder.TOPS_INDEX] = ClothingGameObjects.TOP_GAMEOBJECT.GetComponent <SpriteRenderer>();

        dictPlayerSprites[ClothesHolder.BOTTOMS_INDEX] = ClothingGameObjects.BOTTOM_GAMEOBJECT.GetComponent <SpriteRenderer>();

        dictPlayerSprites[ClothesHolder.SKIN_INDEX] = ClothingGameObjects.SKIN_GAMEOBJECT.GetComponent <SpriteRenderer>();
    }
コード例 #4
0
    public void StartGame()
    {
        cClothes = this.gameObject.GetComponent <ClothesHolder>();
        if (cClothes == null)
        {
            Debug.Log("Game: Start: ClothesHolder is not attached! HELLO?");
        }
        cClothes.Init();

        cSuspicionController = this.gameObject.GetComponent <SuspicionController>();
        if (cSuspicionController == null)
        {
            cSuspicionController = this.gameObject.AddComponent <SuspicionController>();
        }
        cSuspicionController.Init();

        cTargetManager = goTargetManager.GetComponent <TargetManager>();
        if (cTargetManager == null)
        {
            Debug.Log("***WARNING*** cTargetManager NULL");
        }
        cTargetManager.Init();

        goSpawns = GameObject.Find("Spawn Point Container");
        cSpawns  = goSpawns.GetComponent <SpawnPointHolder>();
        if (cSpawns == null)
        {
            Debug.Log("***WARNING*** CSpawns null");
        }
        cSpawns.Reset();

        //Characters
        GameObject player = Instantiate(playerPrefab);

        playerTransform = player.transform;
        PlayerController playerController = player.GetComponent <PlayerController>();

        if (playerController != null)
        {
            playerController.SetClothes(cTargetManager.AgentData);
        }

        npcs.Add(Instantiate(NPCPrefab));
        npcs[npcs.Count - 1].gameObject.transform.position = cSpawns.GetSpawnPoint().position;
        NPCController cNPCController = npcs[npcs.Count - 1].GetComponent <NPCController>();

        if (cNPCController != null)
        {
            cNPCController.SetClothes(cTargetManager.TargetData);
        }

        CharacterCreationData npcData;

        for (int i = 0; i < MAX_NPC; ++i)
        {
            npcs.Add(Instantiate(NPCPrefab));
            npcs[npcs.Count - 1].gameObject.transform.position = cSpawns.GetSpawnPoint().position;
            cNPCController = npcs[npcs.Count - 1].GetComponent <NPCController>();

            if (cNPCController != null)
            {
                npcData = new CharacterCreationData();
                npcData.lID[ClothesHolder.HATS_INDEX]       = 0;
                npcData.lColor[ClothesHolder.HATS_INDEX]    = cTargetManager.iHatID == i ? cTargetManager.TargetData.lColor[ClothesHolder.HATS_INDEX] : new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
                npcData.lID[ClothesHolder.TOPS_INDEX]       = 0;
                npcData.lColor[ClothesHolder.TOPS_INDEX]    = cTargetManager.iTopID == i ? cTargetManager.TargetData.lColor[ClothesHolder.TOPS_INDEX] : new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
                npcData.lID[ClothesHolder.BOTTOMS_INDEX]    = 0;
                npcData.lColor[ClothesHolder.BOTTOMS_INDEX] = cTargetManager.iBottomID == i ? cTargetManager.TargetData.lColor[ClothesHolder.BOTTOMS_INDEX] : new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));

                cNPCController.SetClothes(npcData);
            }
        }

        GameObject.Find("FollowCamera").GetComponent <ShittyFollowCam>().StartCamera();
    }