コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     playerLoc         = GameObject.FindGameObjectWithTag("Player");;
     player            = playerLoc.transform;
     _playerController = playerLoc.GetComponent <PlayerController>();
     _popUpSystem      = playerLoc.GetComponent <PopUpSystem>();
 }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);

        if (isGrounded && velocity.y < 0)
        {
            velocity.y = -50f;
        }

        float x = Input.GetAxis("Horizontal");
        float z = Input.GetAxis("Vertical");

        Vector3 move = transform.right * x + transform.forward * z;

        controller.Move(move * speed * Time.deltaTime);

        if (Input.GetButtonDown("Jump") && isGrounded)
        {
            velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity);
        }

        velocity.y += gravity * Time.deltaTime;

        controller.Move(velocity * Time.deltaTime);

        if (Input.GetKeyDown(KeyCode.Y))
        {
            PopUpSystem pop = GameObject.FindGameObjectWithTag("PopUp System").GetComponent <PopUpSystem>(); //品臻加的
            pop.PopUp(popUp);                                                                                //品臻加的
        }
    }
コード例 #3
0
 // Update is called once per frame
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.name == "MainChar" && bridge1Built == false)
     {
         if (GameManager.stone >= 2 && GameManager.wood >= 3)
         {
             if (Input.GetKey("e"))
             {
                 gameObject.GetComponent <BoxCollider2D>().enabled = false;
                 print("You have collided and pressed 'e'");
                 bridge1Built       = true;
                 GameManager.wood  -= 4;
                 GameManager.stone -= 3;
                 animator.SetBool("bridge1", true);
             }
         }
         else
         {
             if (Input.GetKey("e"))
             {
                 PopUpSystem pop = GameObject.Find("GameManager").GetComponent <PopUpSystem>();
                 pop.PopUp(popUp);
                 print("You need more resources");
             }
         }
     }
     if (bridge1Built)
     {
         print("A bridge piece has been built");
     }
 }
コード例 #4
0
    public void Present()
    {
        exist = true;
        PopUpSystem pop1 = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();

        pop1.PopUpInstru(text);
    }
コード例 #5
0
 public void End()
 {
     if (Boxremain == 0)
     {
         PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
         pop.PopUpInfo("<size=10>" + "Hi, how do you feel on this new Earth?\nI think you have learned about the situation in different regions during your travels, and you have also generated more thoughts.\nWe all have a dream, that is to let the world no longer have conflicts, and the vulnerable groups in conflict——those women can get more protection.\n This path of exploration will be continued by yourself after you go back. Remember to pay more attention to women, girls and gender issues in conflict.\n Your trip has come to an end. I think you miss what you saw just now. But don’t worry, as long as you go out.\nThat better New earth is right in front of you...\n\nDoc. X" + "</size>");
     }
 }
コード例 #6
0
ファイル: APboundary.cs プロジェクト: XZ-XuZhang/DS4D_G10
 public virtual void boundaryUI()
 {
     Thisreg = "Asia and Pacific_Boundary";
     if (lastreg != Thisreg)
     {
         //Debug.Log("Asia and Pacific_Boundary");
         PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
         pop.PopUp("<size=10>" + "Asia and Pacific" + "</size>");
         lastreg = Thisreg;
         // StartCoroutine(PopUpSystem.DelayFuc(() => { pop.Close(); }, 3.0f));
     }
 }
コード例 #7
0
ファイル: MEboundary.cs プロジェクト: XZ-XuZhang/DS4D_G10
 public virtual void boundaryUI()
 {
     Thisreg = "Middle East and North Africa";
     if (lastreg != Thisreg)
     {
         //Debug.Log("Middle East and North Africa");
         PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
         pop.PopUp("<size=10>" + "Middle East \n and North Africa" + "</size>");
         lastreg = Thisreg;
         //StartCoroutine(PopUpSystem.DelayFuc(() => { pop.Close(); }, 3.0f));
     }
 }
コード例 #8
0
ファイル: MiningGame.cs プロジェクト: JSymss/IslandHop
    // Update is called once per frame
    void Update()
    {
        if (state == State.Idle)
        {
            image.sprite = idle[0];
            if (Input.GetKeyDown(KeyCode.S))
            {
                animTimer = 0;
                state     = State.In;
                swingCounter++;
            }
        }

        if (state == State.In)
        {
            if (animTimer < frameCount - 1)
            {
                animTimer   += Time.smoothDeltaTime * speed;
                image.sprite = inAnim[Mathf.FloorToInt(animTimer)];
            }
            else if (Input.GetKeyDown(KeyCode.W))
            {
                animTimer = 0;
                state     = State.Out;
            }
        }
        if (state == State.Out)
        {
            if (animTimer < frameCount - 1)
            {
                animTimer   += Time.smoothDeltaTime * speed;
                image.sprite = outAnim[Mathf.FloorToInt(animTimer)];
            }
            else if (Input.GetKeyDown(KeyCode.S))
            {
                animTimer = 0;
                state     = State.In;
                swingCounter++;
            }
        }
        if (swingCounter >= 3 && frameCount - 1 < animTimer)
        {
            swingCounter = 0;
            PopUpSystem pop = GameObject.Find("GameManager").GetComponent <PopUpSystem>();
            pop.PopUp(popUp);
            this.gameObject.SetActive(false);
            GameManager.stone++;
            playerMovement.freezePlayer = false;
            state = State.Idle;
        }
    }
コード例 #9
0
 public override void BeforeConnection()
 {
     if (Player.instance.Power > 10)
     {
         Menu.GoTo(card.attachedSlot, false);
         Stack.StackAction(() =>
         {
             PopUpSystem.PopText("+10 Power", Vector2.zero, Vector2.up, 1f);
             buffer             = true;
             card.currentPower += 10;
             Player.instance.CheckPower();
         }, 1f);
     }
 }
コード例 #10
0
ファイル: ItemCheck.cs プロジェクト: ecoknows/FarmBili
    private void OnTriggerEnter2D(Collider2D coillder)
    {
        switch (gameObject.tag)
        {
        case "BahayKubo":
            PopUpSystem pop = popUpSystem.GetComponent <PopUpSystem>();    // PWEDE SYANG MAG TANIM
            pop.PopUpInventory();
            break;

        case "Well":
            PlayerNecessity.Instance.RefillWater();
            Debug.Log("Heyo");
            break;
        }
    }
コード例 #11
0
    void Start()
    {
        hintButton     = GetComponent <Button>();
        gameManager    = GameObject.FindObjectOfType <GameManager>();
        dataController = FindObjectOfType <DataController>();
        Question question = gameManager.getCurrentQuestion();

        //PopUpSystem pop = this.GetComponent<PopUpSystem>();
        hintButton.onClick.AddListener(delegate {
            string hintText = gameManager.getCurrentQuestion().hint;
            //StartCoroutine("WaitForSec");
            PopUpSystem pop = this.GetComponent <PopUpSystem>();
            pop.popUp(hintText);
        });
    }
コード例 #12
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            Instance = this;
            DontDestroyOnLoad(Instance);
        }

        Canvas.SetActive(false);
    }
コード例 #13
0
 void Start()
 {
     if (Instance == null)
     {
         isIntro = true;
         LoadIntro();
         if (isIntro)
         {
             PopUpIntro();
         }
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #14
0
    public IEnumerator ActivateCo()
    {
        foreach (var c in Player.instance.rig.cards)
        {
            c.BeforeConnection();
        }
        Player.instance.rig.SetCleanup(attachedSlot);
        while (Stack.Playing)
        {
            yield return(null);
        }
        Player.instance.CheckPower();
        var encounter = Run.instance.currentEncounter;
        var con       = new Connection(this, encounter);

        encounter.OnConnect(con);

        //card trigger stack
        Stack.StackAction(() => { transform.DOPunchPosition(Vector2.up, 0.5f, 0); }, 0.75f);

        while (Stack.Playing)
        {
            yield return(null);
        }
        if (con.successful)
        {
            //card kill stack animation
            Stack.StackAction(() =>
            {
                var pop    = PopUpSystem.PopImage(conIcon, transform.position + (Vector3.up * 1f), Vector2.up, 1f);
                var rend   = pop.GetComponentInChildren <SpriteRenderer>();
                var color  = rend.color;
                rend.color = new Color(color.r, color.g, color.b, 0);
                rend.DOColor(color, 0.5f);
                pop.transform.localScale *= 0.4f;
                pop.transform.DORotate(new Vector3(0, 0, 180), 0.4f).SetEase(Ease.Linear).SetLoops(-1, LoopType.Incremental);
            }, 1f);
            //trigger enemy kill
            encounter.OnKill(con);
        }
        else
        {
            Stack.StackAction(() =>
            {
                var pop    = PopUpSystem.PopImage(failIcon, transform.position + (Vector3.up * 1f), Vector2.up, 1f);
                var rend   = pop.GetComponentInChildren <SpriteRenderer>();
                var color  = rend.color;
                rend.color = new Color(color.r, color.g, color.b, 0);
                rend.DOColor(color, 0.25f);
                pop.transform.localScale *= 0.4f;
                pop.transform.DOScale(pop.transform.localScale * 1f, 0.75f).SetEase(Ease.InOutBack);
            }, 1f);

            foreach (var c in Player.instance.rig.cards)
            {
                c.AfterConnection(con);
            }
            encounter.AfterConnection(con);
            while (Stack.Playing)
            {
                yield return(null);
            }
            if (encounter.counter == encounter.Speed)
            {
                encounter.OnTrigger(con);
            }
        }
        while (Stack.Playing)
        {
            yield return(null);
        }
        Player.instance.connected = false;
        Player.instance.CheckPower();
    }
コード例 #15
0
    // Start is called before the first frame update
    void Start()
    {
        PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();

        pop.PopUp(popUp);
    }
コード例 #16
0
    public void pickUp()
    {
        Debug.DrawRay(transform.position, transform.forward * 2.0f, Color.green);
        if (Input.GetKeyDown(KeyCode.E))
        {
            Collider[] colls = Physics.OverlapSphere(transform.position, 5f); //获取周围物品
            foreach (Collider collider in colls)
            {
                if (collider.gameObject.tag == "pick" && Vector3.Angle(collider.gameObject.transform.position - transform.position, transform.forward) <= 45)
                {
                    print("GET!");



                    if (collider.gameObject == GameObject.Find("APinfo") && APget == false)
                    {
                        PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
                        pop.PopUpInfo("<size=15>" + "Here is Asia and Pacific. They signed 377 peace agreements between 1990 and 2020. However, only 45 of them involve women and gender, which is the smallest proportion. It shows that compared with other areas, there is less extra care for women in conflicts. What caused this phenomenon?" + "</size>");
                        // print("GET22!");
                        APget = true;
                        Boxremain--;
                        Destroy(collider.gameObject, 0.2f);
                        PlayerController.open.Play();
                    }
                    if (collider.gameObject == GameObject.Find("EEinfo") && EEget == false)
                    {
                        PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
                        pop.PopUpInfo("<size=15>" + "This is Europe and Eurasia. They have a lot of peace agreements but just a few related to gender aspects. Besides, the local agreement was relatively concentrated in the early 1990s, but declined over time. Does this demonstrate Europe has done a better job of protecting women's rights?" + "</size>");
                        // print("GET22!");
                        EEget = true;
                        Boxremain--;
                        Destroy(collider.gameObject, 0.2f);
                        PlayerController.open.Play();
                    }
                    if (collider.gameObject == GameObject.Find("MEinfo") && MEget == false)
                    {
                        PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
                        pop.PopUpInfo("<size=15>" + "The number of peace agreements signed in the Middle East and North Africa is relatively medium compared to other regions, but they are concentrated in Israel, Palestinian Territory, Lebanon, Syria, and Iraq. Further research on the rights and interests of women in these countries will help us to further explore the extent to which peace agreements affect women and gender equality." + "</size>");
                        // print("GET22!");
                        MEget = true;
                        Boxremain--;
                        Destroy(collider.gameObject, 0.2f);
                        PlayerController.open.Play();
                    }
                    if (collider.gameObject == GameObject.Find("Afinfo") && Afget == false)
                    {
                        PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
                        pop.PopUpInfo("<size=15>" + "This is Africa(excl MENA). They have the largest number of peace agreements both in all and gender related part, at the same time the proportion of there is also the highest. So many wars have brought disaster to this place. It is hoped that these peace agreements will enable local women to gain a higher status and lead a better life." + "</size>");
                        // print("GET22!");
                        Afget = true;
                        Boxremain--;
                        Destroy(collider.gameObject, 0.2f);
                        PlayerController.open.Play();
                    }
                    if (collider.gameObject == GameObject.Find("Aminfo") && Amget == false)
                    {
                        PopUpSystem pop = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PopUpSystem>();
                        pop.PopUpInfo("<size=15>" + "This is Americas. Interesting, there is a blank of records of peace agreements related to the Americas at the beginning of the 21st century(2000 - 2012). Maybe the lack of data is due to a relatively peaceful period in the Americas in the early 21st century?" + "</size>");
                        // print("GET22!");
                        Amget = true;
                        Boxremain--;
                        Destroy(collider.gameObject, 0.2f);
                        PlayerController.open.Play();
                    }
                }
            }
        }
    }