예제 #1
0
    public void DisplayZombie()
    {
        DeleteZombie();

        _spawnedHeadPart    = heads[0];
        _spawnedTorsoPart   = torsos[0];
        _spawnedArmsPart[0] = arms[0];
        _spawnedArmsPart[1] = arms[0].adjacentPart;
        _spawnedLegsPart[0] = legs[0];
        _spawnedLegsPart[1] = legs[0].adjacentPart;

        _spawnedHead    = Instantiate(heads[0].partObject, headPosition.position, headPosition.rotation, headPosition);
        _spawnedTorso   = Instantiate(torsos[0].partObject, torsoPosition.position, torsoPosition.rotation, torsoPosition);
        _spawnedArms[0] = Instantiate(arms[0].partObject, armLPosition.position, armLPosition.rotation, armLPosition);
        _spawnedArms[1] = Instantiate(arms[0].adjacentPart.partObject, armRPosition.position, armRPosition.rotation, armRPosition);
        _spawnedLegs[0] = Instantiate(legs[0].partObject, legLPosition.position, legLPosition.rotation, legLPosition);
        _spawnedLegs[1] = Instantiate(legs[0].adjacentPart.partObject, legRPosition.position, legRPosition.rotation, legRPosition);

        _spawnedHead.GetComponentInChildren <MeshRenderer>().shadowCastingMode    = ShadowCastingMode.Off;
        _spawnedTorso.GetComponentInChildren <MeshRenderer>().shadowCastingMode   = ShadowCastingMode.Off;
        _spawnedArms[0].GetComponentInChildren <MeshRenderer>().shadowCastingMode = ShadowCastingMode.Off;
        _spawnedArms[1].GetComponentInChildren <MeshRenderer>().shadowCastingMode = ShadowCastingMode.Off;
        _spawnedLegs[0].GetComponentInChildren <MeshRenderer>().shadowCastingMode = ShadowCastingMode.Off;
        _spawnedLegs[1].GetComponentInChildren <MeshRenderer>().shadowCastingMode = ShadowCastingMode.Off;

        CalculateCurrentStats();
    }
예제 #2
0
    public void SwapTorso(int side)
    {
        if ((Side)side == Side.Right)
        {
            if (_torsoIndex < torsos.Count - 1)
            {
                _torsoIndex++;
            }
            else
            {
                _torsoIndex = 0;
            }
        }
        else
        {
            if (_torsoIndex > 0)
            {
                _torsoIndex--;
            }
            else
            {
                _torsoIndex = torsos.Count - 1;
            }
        }

        _spawnedTorso.Destroy();

        _spawnedTorsoPart = torsos[_torsoIndex];

        _spawnedTorso = Instantiate(_spawnedTorsoPart.partObject, torsoPosition.position, torsoPosition.rotation, torsoPosition);

        _spawnedTorso.GetComponentInChildren <MeshRenderer>().shadowCastingMode = ShadowCastingMode.Off;

        CalculateCurrentStats();
    }
    public void Create(ZombiePart part)
    {
        txt_InventoryItemStat.text = part.decayState.ToString();

        // TO DO: silhouettes
        // img_inventoryItemSilhouette.sprite = gameManager.silhouetteDictionary[part.part];

        img_inventoryItem.sprite = part.sprite;
    }
예제 #4
0
 public void AddInventoryItem(ZombiePart newPart)
 {
     Instantiate(prefab_inventoryItem, grp_bottom.transform);
     // add button with listener for
 }