rifaterdemsahin / aif

Adaptive Intelligence Framework
5 stars 7 forks source link

Load words from the repository #175

Closed rifaterdemsahin closed 6 years ago

rifaterdemsahin commented 6 years ago

https://user-images.githubusercontent.com/5270036/44134938-d2d844d6-a05e-11e8-8b56-44fe99056cac.png

pick them from the folder and place them Doing a prefab can be smart.

rifaterdemsahin commented 6 years ago

think on outsourcing the parts....not only you working. you and them working at the same time. Part of the work! not coding it can be also music,design it has to be related.

rifaterdemsahin commented 6 years ago

it can be level design. The first one failed.1

rifaterdemsahin commented 6 years ago

alphabet drive https://drive.google.com/drive/folders/1JtpzpFxrA3sWK-0BqdwhupSaOaIXzl14

rifaterdemsahin commented 6 years ago

place holders needed image

Prefabs starting in the same folder image

rifaterdemsahin commented 6 years ago

Game controller will manuplate them image

rifaterdemsahin commented 6 years ago

// Use this for initialization void Start() {

    letterOne.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[0].ToString();
    letterTwo.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[1].ToString();
    if (Word.Length > 2)
        letterThree.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[2].ToString();
    if (Word.Length > 3)

        letterFour.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[3].ToString();
    if (Word.Length > 4)

        letterFive.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[4].ToString();
    if (Word.Length > 5)

        letterSix.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[5].ToString();
}

did not change them

rifaterdemsahin commented 6 years ago

resource load ? ( ask some game developer questions ) image

rifaterdemsahin commented 6 years ago

Games are all about loadiung them image

rifaterdemsahin commented 6 years ago

can not load so going this way image

Even this is ok in mvp ( iterations will come ) image

active to off image

rifaterdemsahin commented 6 years ago

image

rifaterdemsahin commented 6 years ago

iterations and mapping image

Technical debt hacking image

rifaterdemsahin commented 6 years ago

image

using System; using System.Collections; using System.Collections.Generic; using UnityEngine;

public class setLettersInTheBowl : MonoBehaviour {

public GameObject letterOne;
public GameObject letterTwo;
public GameObject letterThree;

public GameObject letterA;
public GameObject letterB;
public GameObject letterC;
public GameObject letterD;
public GameObject letterE;
public GameObject letterF;
public GameObject letterG;
public GameObject letterH;
public GameObject letterJ;
public GameObject letterK;
public GameObject letterL;
public GameObject letterM;
public GameObject letterN;
public GameObject letterO;
public GameObject letterP;
public GameObject letterR;
public GameObject letterS;
public GameObject letterT;
public GameObject letterU;
public GameObject letterY;
public GameObject letterV;
public GameObject letterX;
public GameObject letter1position;
public GameObject letter2position;
public GameObject letter3position;
public string Word;
// Use this for initialization
void Start()
{

    letterOne = getGameObjectLetter(Word[0]);
    letterOne.transform.position = letter1position.transform.position;

    letterTwo = getGameObjectLetter(Word[1]);
    letterTwo.transform.position = letter2position.transform.position;

    letterThree = getGameObjectLetter(Word[2]);
    letterThree.transform.position = letter3position.transform.position;

    //Copy path
    Sprite a = Resources.Load("Assets/A10poc_lettersdynamic/alphabet/A.png", typeof(Sprite)) as Sprite;
    letterTwo.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[1].ToString();

    // Sprite a = Resources.Load("/alphabet/A.png", typeof(Sprite)) as Sprite;
    //   Sprite a = Resources.Load("alphabet/A.png", typeof(Sprite)) as Sprite;
    //   Sprite a = Resources.Load("A.png", typeof(Sprite)) as Sprite;

    //foreach (var item in GetComponentsInChildren<Sprite>())
    //{
    //    letterOne.GetComponentInChildren<SpriteRenderer>().sprite = item;
    //}

    //letterTwo.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[1].ToString();
    //if (Word.Length > 2)
    //    letterThree.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[2].ToString();
    //if (Word.Length > 3)

    //    letterFour.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[3].ToString();
    //if (Word.Length > 4)

    //    letterFive.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[4].ToString();
    //if (Word.Length > 5)

        //letterSix.GetComponentInChildren<SpriteRenderer>().sprite.name = Word[5].ToString();
}

private GameObject getGameObjectLetter(char v)
{
    if (v == 'S')
        return letterS;
    if (v == 'B')
        return letterB;
    if (v == 'Y')
        return letterY;
    if (v == 'E')
        return letterE;
    return null;
}

// Update is called once per frame
void Update()
{

}

}