Ejemplo n.º 1
0
    // Start and Update
    #region Start and Update, On Enable/Diable, On Screen Loaded, etc.

    void Start()
    {
        myCamera                 = GameObject.FindGameObjectWithTag("MainCamera").transform;
        camZoom                  = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraZoom>();
        audioManager             = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManager>();
        gm                       = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();
        fadeMaskController       = fadeMask.GetComponent <MaskController>();
        introTextController      = IntroTextScreen.GetComponent <IntroTextController>();
        levelSelectionController = levelSelection.GetComponent <LevelSelectionController>();

        string diff = PlayerPrefs.GetString("GameDifficulty", "Goddess");

        if (diff == "LittleGirl")
        {
            gm.goalDifficulty = GameMaster.GameDifficulty.littlegirl;
        }
        else if (diff == "Goddess")
        {
            gm.goalDifficulty = GameMaster.GameDifficulty.goddess;
        }
        gm.gameDifficulty = gm.goalDifficulty;
        if (gm.goalDifficulty == GameMaster.GameDifficulty.littlegirl)
        {
            SetDifficultyToLittleGirl();
        }
        else if (gm.goalDifficulty == GameMaster.GameDifficulty.goddess)
        {
            SetDifficultyToGoddess();
        }

        basicSettings();
        SetPlayerPrefs();
    }
Ejemplo n.º 2
0
        private void SendMask()
        {
            if (tbMaskCode.Text.Trim() == "")
            {
                return;
            }

            for (int i = 1; i <= 8; i++)
            {
                System.Windows.Forms.Control ctrl = FindControl(this, "pic" + i.ToString());
                if (ctrl != null)
                {
                    ctrl.Visible = false;
                }
            }

            MaskController.GetInstance().SendMask(tbMaskCode.Text);
            this.pbImg.Visible      = false;
            this.btnSend.Enabled    = false;
            this.tbSeconds.Text     = "";
            this.tbMaskCode.Enabled = false;
            this.tbMaskCode.Text    = "";

            this.labelInfo.Text = "正在获取验证码";
        }
Ejemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        move       = GetComponent <PlayerMove>();
        jump       = GetComponent <PlayerJump>();
        climb      = GetComponent <PlayerClimb>();
        playerMask = GetComponent <Masks>();
        playerItem = GetComponent <Item>();

        maskController = FindObjectOfType <MaskController>();
        inventory      = FindObjectOfType <Inventory>();
        speech         = FindObjectOfType <SpeechScript>();
        anim           = GetComponent <Animator>();
        grapple        = FindObjectOfType <GrapplingHook>();


        hasJumped     = false;
        hasWallJumped = false;
        isClimbing    = false;
        isZipping     = false;
        moving        = true;
        launched      = false;
        hasRune       = false;

        GetComponent <DistanceJoint2D>().enabled = false;
        maskInventory = new List <string>();
        itemInventory = new List <string>();

        maskCounter = 0;
        itemCounter = 0;

        knockbackCount = knockbackLength;
    }
Ejemplo n.º 4
0
    void Awake()
    {
        if (instance == null)
        {
            instance     = this;
            baseScale    = transform.localScale;
            currentScale = baseScale;

            // by default set to minimum
            transform.localScale = new Vector3(2f, 0f, 2f);
        }
        else
        {
            Destroy(gameObject);
        }
    }
Ejemplo n.º 5
0
    void Awake()
    {
        myAgent = this.GetComponent<NavMeshAgent>();

        if (inStencilScene)
        {
            if (visibilityBubble == null)
            {
                visibilityBubble = this.GetComponentInChildren<MaskController>();
            }
            else
            {
                visibilityBubble.gameObject.SetActive(true);   
            }
            
        }
    }
Ejemplo n.º 6
0
        private void MainDlg_Load(object sender, EventArgs e)
        {
            this.pbImg.Visible = false;
            this.Visible       = false;
            MaskController.GetInstance().CurState = OptStatus.NOT_LOGIN;
            MaskController.GetInstance().HWnd     = this.Handle;
            MaskController.GetInstance().Start();


            this.pic1.Parent = this.pbImg;
            this.pic2.Parent = this.pbImg;
            this.pic3.Parent = this.pbImg;
            this.pic4.Parent = this.pbImg;
            this.pic5.Parent = this.pbImg;
            this.pic6.Parent = this.pbImg;
            this.pic7.Parent = this.pbImg;
            this.pic8.Parent = this.pbImg;
            //Win32API.SetForegroundWindow(this.Handle);
            //this.TopMost = true;
            //this.Activate();
        }
Ejemplo n.º 7
0
    // Start is called before the first frame update
    void Start()
    {
        move       = GetComponent <PlayerMove>();
        jump       = GetComponent <PlayerJump>();
        climb      = GetComponent <PlayerClimb>();
        playerMask = GetComponent <Masks>();

        maskController = FindObjectOfType <MaskController>();
        speech         = FindObjectOfType <SpeechScript>();
        anim           = GetComponent <Animator>();


        hasJumped     = false;
        hasWallJumped = false;
        isClimbing    = false;
        isZipping     = false;

        GetComponent <DistanceJoint2D>().enabled = false;
        maskInventory = new List <string>();

        maskCounter = 0;

        knockbackCount = knockbackLength;
    }
Ejemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        // Vector2 movement = Vector2.zero;
        if (Input.GetKeyDown(up) == true && firstJump == false)
        {
            bottomCollider.GetComponent <BottomCollision>().collided = false;
            Debug.Log("Jumping");
            rigbod.velocity = new Vector2(rigbod.velocity.x, jumpForce);
            firstJump       = true;
            animator.SetBool("Jumping", true);
            FMODUnity.RuntimeManager.PlayOneShot("event:/SFX/Jump");
        }
        else if (Input.GetKeyDown(up) == true && firstJump == true && secondJump == false && Input.GetKey(left) == false && Input.GetKey(right) == false)
        {
            rigbod.velocity = new Vector2(rigbod.velocity.x, jumpForce);
            secondJump      = true;
            Debug.Log("Jumping2");
            animator.SetBool("Jumping", true);
            FMODUnity.RuntimeManager.PlayOneShot("event:/SFX/Jump");
        }
        else if (Input.GetKeyUp(up) == true)
        {
            animator.SetBool("Jumping", false);
        }
        else if (Input.GetKeyDown(up) == true && firstJump == true && secondJump == false && bugJump == false)
        {
            rigbod.velocity = new Vector2(rigbod.velocity.x, jumpForce);
            bugJump         = true;
            FMODUnity.RuntimeManager.PlayOneShot("event:/SFX/Jump");
        }

        if (Input.GetKey(right))
        {
            rigbod.velocity = new Vector2(speed, rigbod.velocity.y);
            sR.flipX        = false;
            animator.SetBool("Walking", true);
        }
        if (Input.GetKey(left))
        {
            rigbod.velocity = new Vector2(-speed, rigbod.velocity.y);
            sR.flipX        = true;
            animator.SetBool("Walking", true);
        }
        if (Input.GetKeyUp(left) == true || Input.GetKeyUp(right) == true || Input.GetKeyUp(up) == true)
        {
            animator.SetBool("Walking", false);
            rigbod.velocity = new Vector2(0, rigbod.velocity.y);
        }
        if (Input.GetKeyDown(spawnTile) == true && allowSpawn == true)
        {
            Transform shotPointTransform = this.GetComponentInChildren <Transform>();
            Debug.Log(this.GetComponentInChildren <Transform>().name);
            if (sR.flipX == true)
            {
                if (this.name == "CharacterA")
                {
                    Vector2 shotPoint = new Vector2(Mathf.Round(shotPointTransform.position.x) - 1.5f, Mathf.Round(shotPointTransform.position.y) + 0.5f);
                    Instantiate(tile, shotPoint, Quaternion.Euler(0, 180, 0));
                }
                else if (this.name == "CharacterB")
                {
                    Vector2 shotPoint = new Vector2(Mathf.Round(shotPointTransform.position.x) - 1.5f, Mathf.Round(shotPointTransform.position.y) - 0.5f);
                    Instantiate(tile, shotPoint, Quaternion.Euler(0, 180, 0));
                }
            }
            else if (sR.flipX == false)
            {
                if (this.name == "CharacterA")
                {
                    Vector2 shotPoint = new Vector2(Mathf.Round(shotPointTransform.position.x) + 1.5f, Mathf.Round(shotPointTransform.position.y) + 0.5f);
                    Instantiate(tile, shotPoint, Quaternion.Euler(0, 180, 0));
                }
                else if (this.name == "CharacterB")
                {
                    Vector2 shotPoint = new Vector2(Mathf.Round(shotPointTransform.position.x) + 1.5f, Mathf.Round(shotPointTransform.position.y) - 0.5f);
                    Instantiate(tile, shotPoint, Quaternion.Euler(0, 180, 0));
                }
            }
        }

        if (Input.GetKeyDown(shoot) == true && !Input.GetKeyDown(KeyCode.RightAlt))
        {
            animator.SetBool("Punching", true);
            FMODUnity.RuntimeManager.PlayOneShot("event:/SFX/Shoot");
            Transform shotPointTransform = this.GetComponentInChildren <Transform>();
            //changes position of bullet spawning point
            if (sR.flipX == true)
            {
                Vector3    shotPoint = new Vector3(shotPointTransform.position.x - 0.8f, shotPointTransform.position.y, shotPointTransform.position.z);
                GameObject go        = Instantiate(bullet, shotPoint, Quaternion.Euler(0, 180, 0));
                go.GetComponent <Rigidbody2D>().velocity = new Vector2(-1, 0) * bulletSpeed;
            }
            else if (sR.flipX == false)
            {
                Vector3    shotPoint = new Vector3(shotPointTransform.position.x + 0.8f, shotPointTransform.position.y, shotPointTransform.position.z);
                GameObject go        = Instantiate(bullet, shotPoint, Quaternion.identity);
                go.GetComponent <Rigidbody2D>().velocity = new Vector2(1, 0) * bulletSpeed;
            }
        }
        else if (Input.GetKeyUp(shoot) == true)
        {
            animator.SetBool("Punching", false);
        }



        //timer for power ups
        if (speed == 1 || speed == 7 || speed == 0)
        {
            targetTime -= Time.deltaTime;
            if (targetTime <= 0)
            {
                speed      = 5;
                targetTime = restartTargetTime;
                MaskController maskController = this.GetComponent <MaskController>();
                maskController.maskObjSpriteRender.sprite = null;
                FootstepsManagerPlayer.GetComponent <FootstepsManagerPlayer>().playerisslimed = false;
                FootstepsManagerPlayer.GetComponent <FootstepsManagerPlayer>().playerisfast   = false;
            }
        }
        else if (allowSpawn == true)
        {
            targetTime -= Time.deltaTime;
            if (targetTime <= 0)
            {
                allowSpawn = false;
                targetTime = restartTargetTime;
                MaskController maskController = this.GetComponent <MaskController>();
                maskController.maskObjSpriteRender.sprite = null;
            }
        }
    }
Ejemplo n.º 9
0
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            //接收自定义消息MYMESSAGE,并显示其参数
            case MsgDef.CLOSE_MSG:
            {
                MaskController.GetInstance().WaitStop(1000);
                System.Environment.Exit(0);
            }
            break;

            case MsgDef.UPDATE_IMG:
            {
                this.pbImg.Visible = true;
                //if(cbAutoShow.Checked)
                this.btnSend.Enabled = true;
                this.tbMaskCode.Focus();
                this.tbMaskCode.Text    = "";
                this.tbMaskCode.Enabled = true;
                this.pbImg.Image        = ShowData.GetInstance().Pic;
                this.Show();

                if (cbBeep.Checked)
                {
                    Win32API.MessageBeep(Win32API.MessageBeepType.Error);
                }

                notifyIcon1.Visible = false;
                if (cbAutoShow.Checked)
                {
                    this.WindowState = FormWindowState.Normal;
                    Win32API.SetForegroundWindow(this.Handle);
                    this.TopMost = true;
                    this.Activate();
                }
            }
            break;

            case MsgDef.CNTR_MSG:
            {
                this.tbTodayCntr.Text = ShowData.GetInstance().TodayCntr.ToString();
                this.tbRightCntr.Text = ShowData.GetInstance().SuccCntr.ToString();
                this.tbErrorCntr.Text = ShowData.GetInstance().FailCntr.ToString();
                this.tbInputCntr.Text = ShowData.GetInstance().TyperCntr.ToString();
                this.tbWaitCntr.Text  = ShowData.GetInstance().RemainCntr.ToString();
                this.tbInfor.Text     = ShowData.GetInstance().WarnMsg.ToString();
            }

            break;

            case MsgDef.REMAIN_SECONDS_MSG:
            {
                this.tbSeconds.Text = m.WParam.ToString();
                this.labelInfo.Text = "请在" + tbSeconds.Text + "秒内输入结果";
                //this.Text = "请在" + tbSeconds.Text + "秒内输入结果";

                if ((int)m.WParam == 0)
                {
                    if (tbMaskCode.Text.Trim() != "")
                    {
                        SendMask();
                    }
                }
            }
            break;

            case MsgDef.START_BTN_MSG:
            {
                if (m.WParam.ToString() == "0")
                {
                    this.btnStart.Text  = "暂停";
                    this.labelInfo.Text = "欢迎使用19e打码器!";
                    this.Text           = "欢迎使用19e打码器!";
                    this.tbMaskCode.Focus();
                }
                else
                {
                    if (m.LParam.ToString() == "1")
                    {
                        this.tbInfor.Text = "3次没有输入,暂停获取验证码";
                    }

                    this.btnStart.Text  = "开始";
                    this.labelInfo.Text = "欢迎使用19e打码器!";
                    this.Text           = "欢迎使用19e打码器!";
                }
            }
            break;

            case MsgDef.HEART_BEAT_MSG:
            {
                this.TopMost = false;
                dotNum       = (dotNum + 1) % 10;
                string str = "";
                for (int i = 0; i < dotNum; i++)
                {
                    str += ".";
                }
                this.labelInfo.Text = "正在获取验证码" + str;
                //this.Text = "正在获取验证码" + str;
            }
            break;

            case MsgDef.LOGIN_MSG:
            {
                if (m.WParam.ToString() == "0")
                {
                    this.Hide();
                }
                else
                {
                    this.lbLoginInfo.Text = "欢迎你," + SysConfig.GetInstance().UserName;
                    this.Show();
                }
            }
            break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }
Ejemplo n.º 10
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     MaskController.GetInstance().StartGetMask();
 }
Ejemplo n.º 11
0
 //initialize the mask from MaskController, giving the reference to the controller and the mask ID
 public void InitMask(MaskController con, int i)
 {
     control = con;
     id      = i;
 }
Ejemplo n.º 12
0
    // Update is called once per frame
    void LateUpdate()
    {
        if (!isPaused && Player.HasOrbem())
        {
            if (Player.CanSwitchWorld() && UIPowerBar.IsEmpty() && !WorldManager.IsWorldFuture() && MaskController.CanBeOpenedOrClosed())
            {
                StartCoroutine(TeleportToFuture());
            }


            if (Input.GetButtonDown("Open/Close Gate") && CanSwitchWorld())
            {
                SwitchWorld();
            }

            if (WorldManager.IsWorldFuture() && Input.GetButtonDown("MiniMap") && !UIPowerBar.IsEmpty())
            {
                MiniMapController.SwitchMiniMapState();
            }

            if (Input.GetKeyDown("v"))
            {
                Debug.Log("Start decrease");
                UIPowerBar.StartDecrease(2f);
            }

            if (Input.GetKeyDown("b"))
            {
                Debug.Log("Start regen");
                UIPowerBar.StartRegen();
            }
        }


        if (Input.GetButtonDown("Pause"))
        {
            if (isPaused)
            {
                Resume();
                UIManager.HidePauseMenu();
            }
            else
            {
                Pause();
                UIManager.DisplayPauseMenu();
            }
        }

        // delay next update by 1 frame to prevent from "jumping" with a controller
        if (isPaused && pauseExited)
        {
            isPaused    = false;
            pauseExited = false;
        }
    }
Ejemplo n.º 13
0
 public bool CanSwitchWorld()
 {
     return(Player.CanSwitchWorld() && !UIPowerBar.IsEmpty() && MaskController.CanBeOpenedOrClosed());
 }
Ejemplo n.º 14
0
 public void OnBlackClicked()
 {
     MaskController.Open(MaskType.FOREGROUND, Color.black, strOnCompleteFunc: "onOpened", objOnCompleteTarget: gameObject);
     Invoke("closeForegroundMask", 0.5f);
 }
Ejemplo n.º 15
0
 private void closeBackgroundMask()
 {
     MaskController.Close(MaskType.BACKGROUND, strOnCompleteFunc: "onClosed", objOnCompleteTarget: gameObject);
 }
Ejemplo n.º 16
0
 public void OnRedClicked()
 {
     MaskController.Open(MaskType.BACKGROUND, Color.red, strOnCompleteFunc: "onOpened", objOnCompleteTarget: gameObject);
     Invoke("closeBackgroundMask", 0.5f);
 }
Ejemplo n.º 17
0
 private void MainDlg_FormClosing(object sender, FormClosingEventArgs e)
 {
     notifyIcon1.Visible = false;
     MaskController.GetInstance().WaitStop(1000);
 }
 // Use this for initialization
 void Start()
 {
     GameObject.DontDestroyOnLoad(gameObject);
     McInstantce = this;
     StartCoroutine("StartGameEnumerator");
 }