示例#1
0
 void Awake()
 {
     if (curInstance == null)
     {
         curInstance = this;
     }
 }
示例#2
0
    public void Win()
    {
        leavebut.SetActive(true);
        slotpanel.SetActive(false);
        winpanel.SetActive(true);
        losepanel.SetActive(false);
        minorwinpanel.SetActive(false);

        DowntownControl.GetPlayer().iteminv.AddCoins(1000);
    }
示例#3
0
 public void StartSlots()
 {
     if (DowntownControl.GetPlayer().iteminv.Coins() >= 50)
     {
         leavebut.SetActive(false);
         startbut.SetActive(false);
         DowntownControl.GetPlayer().iteminv.SubstractCoins(50);
         StartCoroutine("GoSlots");
     }
 }
示例#4
0
    public void Yee()
    {
        intro.SetActive(false);
        success.SetActive(false);

        if (DowntownControl.GetPlayer().iteminv.Coins() >= 750)
        {
            pickmon.SetActive(true);
            fail.SetActive(false);
        }
        else
        {
            pickmon.SetActive(false);
            fail.SetActive(true);
        }
    }
示例#5
0
    public void IsComplete(Monster.SubMonster test)
    {
        turninpanel.SetActive(false);
        int thepay = thequest.pay;

        if (CheckComplete(test))
        {
            successpanel.SetActive(true);
            DowntownControl.GetPlayer().iteminv.AddCoins(thepay);
            DowntownControl.GetPlayer().moninv.RemoveMonster(test);
            thequest.ClearQuest();
        }
        else
        {
            failpanel.SetActive(true);
        }
    }
示例#6
0
    private void OnEnable()
    {
        Monster.SubMonster[] acts = DowntownControl.GetPlayer().moninv.ReturnActives();
        for (int i = 0; i < 3; i++)
        {
            //acticons[i].GetComponent<InvSlot>().SnapBack();

            if (acts[i] != null)
            {
                images[i].GetComponent <Image>().sprite       = Resources.Load("MonsterSprites/" + acts[i].imagepath, typeof(Sprite)) as Sprite;
                images[i].GetComponent <InvSlot>().curMonster = acts[i];
                //images[i].GetComponent<InvSlot>().ISNULL = false;
            }
            else
            {
                images[i].GetComponent <Image>().sprite = null;

                images[i].GetComponent <InvSlot>().curMonster = null;
                images[i].GetComponent <InvSlot>().curItem    = null;
                //acticons[i].GetComponent<InvSlot>().ISNULL = true;
            }
        }

        Monster.SubMonster[] backs = DowntownControl.GetPlayer().moninv.ReturnMain();

        for (int i = 0; i < 10; i++)
        {
            if (backs[i] != null)
            {
                images[i + 3].GetComponent <Image>().sprite       = Resources.Load("MonsterSprites/" + backs[i].imagepath, typeof(Sprite)) as Sprite;
                images[i + 3].GetComponent <InvSlot>().curMonster = backs[i];
                //images[i].GetComponent<InvSlot>().ISNULL = false;
            }
            else
            {
                images[i + 3].GetComponent <Image>().sprite       = null;
                images[i + 3].GetComponent <InvSlot>().curMonster = null;
                images[i + 3].GetComponent <InvSlot>().curItem    = null;
                //images[i].GetComponent<InvSlot>().ISNULL = true;
            }
        }
    }
示例#7
0
    private void Update()
    {
        if (Input.touchCount == 1 && onehit)
        {
            // touch on screen
            if (Input.GetTouch(0).phase == TouchPhase.Began)
            {
                Ray        ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
                RaycastHit hit = new RaycastHit();
                moving = Physics.Raycast(ray, out hit);
                if (moving)
                {
                    if (hit.transform.gameObject.GetComponent <InvSlot>() != null)
                    {
                        if (hit.transform.gameObject.GetComponent <InvSlot>().curMonster != null)
                        {
                            go = hit.transform.gameObject;
                        }
                    }
                    //Debug.Log("Touch Detected on : " + go.name);
                }
                else
                {
                    onehit = false;
                }
            }


            // release touch/dragging
            if ((Input.GetTouch(0).phase == TouchPhase.Ended || Input.GetTouch(0).phase == TouchPhase.Canceled || Input.touchCount != 1) && go != null && onehit)
            {
                Ray        ray = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
                RaycastHit hit = new RaycastHit();
                moving = Physics.Raycast(ray, out hit);
                if (moving)
                {
                    if (hit.transform.gameObject.GetComponent <InvSlot>() != null)
                    {
                        if (hit.transform.gameObject.GetComponent <InvSlot>().curMonster != null)
                        {
                            go2 = hit.transform.gameObject;
                        }
                    }
                }
                moving = false;

                if (go == go2)
                {
                    MonInit.RandomMoves(go.GetComponent <InvSlot>().curMonster);
                    DowntownControl.GetPlayer().iteminv.SubstractCoins(750);
                    Success();
                }
            }
        }
        else
        {
            go     = null;
            go2    = null;
            onehit = true;
        }
    }