コード例 #1
0
    public void Collect()
    {
        SCR_collectableSpawner.collectableTotal--;
        SCR_collectableSpawner.spawnPointOccupied[spawnSlot] = 0;

        isActive    = false;
        fadeCounter = 1.5f;

        if (collectEffectObj)
        {
            GameObject collectEffectInst = Instantiate(collectEffectObj, transform.position, Quaternion.identity) as GameObject;
        }

        if (SND_collect)
        {
            SND_collect.PlaySound();

            if (collectPoints == true)
            {
                SCR_main.score += points;

                if (SCR_main.pOn)
                {
                    SCR_text p = SCR_gui.CreateText("PopUpPoints", Vector3.zero);
                    p.UpdateText(points.ToString());
                    p.SetWorldPos(transform.position, 1f);
                    p.SetFadeSpeed(0.55f, 0.2f);
                }
            }
        }

        flashOn = true;
        DisplayFlash();
    }
コード例 #2
0
    public static void OptionCycle(int com)
    {
        GameObject[] options = GameObject.FindGameObjectsWithTag("Option");

        foreach (GameObject option in options)
        {
            if (option.GetComponent <SCR_option>())
            {
                SCR_option o = option.GetComponent <SCR_option>();

                int action = 0;

                if (com == 0)
                {
                    action = o.Highlight(0, mousePos);

                    if (action == 1)
                    {
                        if (SND_highlight)
                        {
                            SND_highlight.PlaySound();
                        }
                    }
                }
                if (com == 1)
                {
                    action = o.Highlight(1, mousePos);

                    if (action == 2 || action == 3)
                    {
                        if (SND_select)
                        {
                            SND_select.PlaySound();
                        }
                        if (action == 2)
                        {
                            rightClickAction = -1;
                        }
                    }
                }
                if (com == 2)
                {
                    o.OptionEvent(0);
                }
                if (com == 3)
                {
                    o.Kill();
                }
                if (com == 4)
                {
                    o.OptionEvent(1);
                }
            }
        }
    }
コード例 #3
0
    public void RollStart()
    {
        if (rolling == 0 && stunned == 0)
        {
            AttackCancel();

            rolling     = 1;
            rollCounter = 0f;

            speed[1] = (dir * rollSpeed);
            speed[0] = speed[1];

            rotTarget = Quaternion.Euler(new Vector3(0f, rotAngle, 0f));

            PlayAnim(4);

            if (SND_roll)
            {
                SND_roll.PlaySound();
            }

            SetRotTarget();
        }
    }