Ejemplo n.º 1
0
    private void Awake()
    {
        moneyValue     = GameObject.Find("MoneyValue").GetComponent <TextMeshProUGUI>();
        canvasCommon   = GameObject.Find("CanvasCommon");
        canvasDialog   = GameObject.Find("CanvasDialog");
        networkMenu    = GameObject.Find("NetworkMenu");
        canvasShop     = GameObject.Find("CanvasShop");
        canvasControl  = GameObject.Find("CanvasControl");
        interactButton = GameObject.Find("InteractButton").GetComponent <DInteractButton>();
        joystick       = GameObject.Find("Joystick").GetComponent <Joystick>();
        shop           = GameObject.Find("Shop").GetComponent <DShop>();
        shop.CreateShop();
        globalLight    = GameObject.Find("GlobalLight").GetComponent <Light2D>();
        mapGenerator   = GameObject.Find("MapGenerator").GetComponent <DMapGenerator>();
        cameraMain     = GameObject.Find("MainCamera").GetComponent <Camera>();
        cameraScript   = GameObject.Find("MainCamera").GetComponent <DCamera>();
        effector       = GameObject.Find("Effector").GetComponent <DEffector>();
        networkManager = GameObject.Find("NetworkManager").GetComponent <CustomNetworkManager> ();
        pokemonSystem  = GameObject.Find("PokemonSystem").GetComponent <DPokemonSystem>();
        pokemonControl = GameObject.Find("PokemonControl");
        pokemonEnemy   = GameObject.Find("PokemonEnemy");
        //pokemonControl.SetActive(false);

        poolObjects = new List <GameObject>();
        poolNames   = new List <string>();
        canvasDialog.SetActive(false);
        canvasShop.SetActive(false);

        DStat stat = new DStat();
    }
Ejemplo n.º 2
0
    public void Attack(Vector3 position, DStat data)
    {
        string attackDirection = Facing;

        Stand();
        if (attackDirection == "up")
        {
            animator.StartPriorAnimation(data.attack_up);
        }
        else if (attackDirection == "down")
        {
            animator.StartPriorAnimation(data.attack_down);
        }
        else if (attackDirection == "left")
        {
            animator.StartPriorAnimation(data.attack_left);
        }
        else if (attackDirection == "right")
        {
            animator.StartPriorAnimation(data.attack_right);
        }
        else
        {
            animator.StartPriorAnimation(data.attack_up);
        }
        Update();
        //Pause(data.pauseTimeAfterAttack);
    }
Ejemplo n.º 3
0
    void Start()
    {
        DStat stat = DGameSystem.LoadStat(npcSpriteSheetName);

        if (GetComponent <DMovement>() != null)
        {
            GetComponent <DMovement>().data = stat;
        }
        if (GetComponent <DBattle>() != null)
        {
            GetComponent <DBattle>().stat = stat;
        }
        if (GetComponent <DFollow>() != null)
        {
            GetComponent <DFollow>().data = stat;
        }
    }
    void Awake()
    {
        DStat stat = DGameSystem.pokemonSystem.LoadStat(pokeId, isShiny, isAlola);

        if (GetComponent <DMovement>() != null)
        {
            GetComponent <DMovement>().data = stat;
        }
        if (GetComponent <DBattle>() != null)
        {
            GetComponent <DBattle>().stat = stat;
        }
        if (GetComponent <DFollow>() != null)
        {
            GetComponent <DFollow>().data = stat;
        }
    }
Ejemplo n.º 5
0
    public static DStat LoadStat(string statName)
    {
        Sprite[] sprites = Resources.LoadAll <Sprite>(statName);

        Sprite up     = sprites[0];
        Sprite up1    = sprites[2];
        Sprite up2    = sprites[10];
        Sprite down   = sprites[5];
        Sprite down1  = sprites[8];
        Sprite down2  = sprites[11];
        Sprite left   = sprites[6];
        Sprite left1  = sprites[3];
        Sprite left2  = sprites[9];
        Sprite right  = sprites[1];
        Sprite right1 = sprites[4];
        Sprite right2 = sprites[7];

        DStat stat = new DStat();

        stat.stand_up    = new Sprite[] { up };
        stat.stand_down  = new Sprite[] { down };
        stat.stand_left  = new Sprite[] { left };
        stat.stand_right = new Sprite[] { right };

        stat.go_up    = new Sprite[] { up, up1, up, up2 };
        stat.go_down  = new Sprite[] { down, down1, down, down2 };
        stat.go_left  = new Sprite[] { left, left1, left, left2 };
        stat.go_right = new Sprite[] { right, right1, right, right2 };

        stat.run_up    = new Sprite[] { up, up1, up, up2 };
        stat.run_down  = new Sprite[] { down, down1, down, down2 };
        stat.run_left  = new Sprite[] { left, left1, left, left2 };
        stat.run_right = new Sprite[] { right, right1, right, right2 };

        return(stat);
    }
    public DStat LoadStat(int pokeId)
    {
        string num3 = "";

        if (pokeId < 10)
        {
            num3 = "00" + pokeId.ToString();
        }
        else if (pokeId < 100)
        {
            num3 = "0" + pokeId.ToString();
        }
        else
        {
            num3 = pokeId.ToString();
        }

        Sprite[] sprites;
        if (isShiny)
        {
            sprites = Resources.LoadAll <Sprite>(num3 + "s");
        }
        else
        {
            sprites = Resources.LoadAll <Sprite>(num3);
        }

        Sprite down1 = sprites[0];
        Sprite down2 = sprites[1];
        Sprite down3 = sprites[2];
        Sprite down4 = sprites[3];

        Sprite left1 = sprites[4];
        Sprite left2 = sprites[5];
        Sprite left3 = sprites[6];
        Sprite left4 = sprites[7];

        Sprite right1 = sprites[8];
        Sprite right2 = sprites[9];
        Sprite right3 = sprites[10];
        Sprite right4 = sprites[11];

        Sprite up1 = sprites[11];
        Sprite up2 = sprites[12];
        Sprite up3 = sprites[13];
        Sprite up4 = sprites[14];

        //Sprite up1 = Resources.Load<Sprite>("pokeup1 (" + pokeId + ")");
        //Sprite up2 = Resources.Load<Sprite>("pokeup2 (" + pokeId + ")");

        //Sprite down1 = Resources.Load<Sprite>("pokedown1 (" + pokeId + ")");
        //Sprite down2 = Resources.Load<Sprite>("pokedown2 (" + pokeId + ")");

        //Sprite left1 = Resources.Load<Sprite>("pokeleft1 (" + pokeId + ")");
        //Sprite left2 = Resources.Load<Sprite>("pokeleft2 (" + pokeId + ")");

        //Sprite right1 = Resources.Load<Sprite>("pokeright1 (" + pokeId + ")");
        //Sprite right2 = Resources.Load<Sprite>("pokeright2 (" + pokeId + ")");

        DStat stat = new DStat();

        stat.stand_up    = new Sprite[] { up1 };
        stat.stand_down  = new Sprite[] { down1 };
        stat.stand_left  = new Sprite[] { left1 };
        stat.stand_right = new Sprite[] { right1 };

        stat.go_up    = new Sprite[] { up1, up2, up3, up4 };
        stat.go_down  = new Sprite[] { down1, down2, down3, down4 };
        stat.go_left  = new Sprite[] { left1, left2, left3, left4 };
        stat.go_right = new Sprite[] { right1, right2, right3, right4 };

        stat.run_up    = new Sprite[] { up1, up2, up3, up4 };
        stat.run_down  = new Sprite[] { down1, down2, down3, down4 };
        stat.run_left  = new Sprite[] { left1, left2, left3, left4 };
        stat.run_right = new Sprite[] { right1, right2, right3, right4 };

        stat.attack_up    = new Sprite[] { up1, up2, up3, up4 };
        stat.attack_down  = new Sprite[] { down1, down2, down3, down4 };
        stat.attack_left  = new Sprite[] { left1, left2, left3, left4 };
        stat.attack_right = new Sprite[] { right1, right2, right3, right4 };

        stat.speed            = 0.5f;
        stat.attackObjectName = "Attack";
        stat.attackRange      = 0.2f;

        return(stat);
    }
Ejemplo n.º 7
0
    public static Sprite[] GetSpriteSheet(DStat data, string movementState)
    {
        Sprite[] result = null;

        if (movementState == "stand_up")
        {
            result = data.stand_up;
        }
        else if (movementState == "stand_down")
        {
            result = data.stand_down;
        }
        else if (movementState == "stand_left")
        {
            result = data.stand_left;
        }
        else if (movementState == "stand_right")
        {
            result = data.stand_right;
        }

        else if (movementState == "go_up")
        {
            result = data.go_up;
        }
        else if (movementState == "go_down")
        {
            result = data.go_down;
        }
        else if (movementState == "go_left")
        {
            result = data.go_left;
        }
        else if (movementState == "go_right")
        {
            result = data.go_right;
        }

        else if (movementState == "attack_up")
        {
            result = data.attack_up;
        }
        else if (movementState == "attack_down")
        {
            result = data.attack_down;
        }
        else if (movementState == "attack_left")
        {
            result = data.attack_left;
        }
        else if (movementState == "attack_right")
        {
            result = data.attack_right;
        }

        else if (movementState == "run_up")
        {
            result = data.run_up;
        }
        else if (movementState == "run_down")
        {
            result = data.run_down;
        }
        else if (movementState == "run_left")
        {
            result = data.run_left;
        }
        else if (movementState == "run_right")
        {
            result = data.run_right;
        }

        return(result);
    }