Exemple #1
0
    void Awake()
    {
        pawnSprite           = transform.FindChild("Pawn").GetComponent <SpriteRenderer>();
        pawnReflectionSprite = transform.FindChild("PawnReflection").GetComponent <SpriteRenderer>();

        if (pokemonID != 0)
        {
            pawnLightSprite           = transform.FindChild("PawnLight").GetComponent <SpriteRenderer>();
            pawnLightReflectionSprite = transform.FindChild("PawnLightReflection").GetComponent <SpriteRenderer>();
            npcLight = transform.FindChild("Point light").GetComponent <Light>();
        }

        hitBox = transform.FindChild("NPC_Object");
        if (pokemonID == 0)
        {
            spriteSheet = Resources.LoadAll <Sprite>("OverworldNPCSprites/" + npcSpriteName);
        }
        else
        {
            spriteSheet = OwnedPokemon.GetSpriteFromID(pokemonID.ToString(), false, false);

            // ToDo: Find out what is this f*****g light !
            //npcLight.intensity = PokemonDatabase.Instance.GetPokemonSpeciesByGameId(pokemonID).getLuminance();
            //npcLight.color = PokemonDatabase.Instance.GetPokemonSpeciesByGameId(pokemonID).getLightColor();
            lightSheet = OwnedPokemon.GetSpriteFromID(pokemonID.ToString(), false, true);
        }

        exclaim = transform.FindChild("Exclaim").gameObject;
    }