상속: MonoBehaviour
예제 #1
0
 public void Strike(LaserMove laser)
 {
     Destroy(laser.gameObject);
     var diff = Diff(laser.Colour, this.renderer.material.color);
     if (Math.Round(diff, 0) != 0.0)
         Omnomnom -= diff;
     else
         Omnomnom += 1;
 }
예제 #2
0
    public void Notify(LaserMove laser)
    {
        if (TileObject != null)
        {
            var script = TileObject.GetScript<IGridObject>();
            if (script != null)
                script.Strike(laser);
        }

        laser.Move();
    }
예제 #3
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        LaserMove laser = collision.GetComponent <LaserMove>();

        if (laser != null)
        {
            rb.velocity = Vector2.zero;
            rb.AddForce(laser.push, ForceMode2D.Impulse);
            charControl          = false;
            timeStartLostControl = timeToControl;
        }
    }
예제 #4
0
    public void Notify(LaserMove laser)
    {
        if (TileObject != null)
        {
            var script = TileObject.GetScript <IGridObject>();
            if (script != null)
            {
                script.Strike(laser);
            }
        }

        laser.Move();
    }
예제 #5
0
    public void Strike(LaserMove laser)
    {
        if (_orientation == MirrorOrientation.BackSlash)
        {
            switch (laser.Direction)
            {
            case GridDirection.East:
                laser.Direction = GridDirection.South;
                break;

            case GridDirection.West:
                laser.Direction = GridDirection.North;
                break;

            case GridDirection.North:
                laser.Direction = GridDirection.West;
                break;

            case GridDirection.South:
                laser.Direction = GridDirection.East;
                break;

            default:
                throw new ArgumentException("Mellon exception");
            }
        }
        else
        {
            switch (laser.Direction)
            {
            case GridDirection.East:
                laser.Direction = GridDirection.North;
                break;

            case GridDirection.West:
                laser.Direction = GridDirection.South;
                break;

            case GridDirection.North:
                laser.Direction = GridDirection.East;
                break;

            case GridDirection.South:
                laser.Direction = GridDirection.West;
                break;

            default:
                throw new ArgumentException("Mellon exception");
            }
        }
    }
예제 #6
0
    public void Strike(LaserMove laser)
    {
        Destroy(laser.gameObject);
        var diff = Diff(laser.Colour, this.renderer.material.color);

        if (Math.Round(diff, 0) != 0.0)
        {
            Omnomnom -= diff;
        }
        else
        {
            Omnomnom += 1;
        }
    }
예제 #7
0
    void Start()
    {
        FB.Init(SetInit, OnHideUnity);
        //lets show the cursor and unlock it (incase it was).
        Screen.lockCursor = false;
        Screen.showCursor = true;
        Time.timeScale    = 1;

        m_on = true;
        Debug.Log(Application.persistentDataPath + "/PlayerPrefs.txt");
        //showHighScore = PreviewLabs.PlayerPrefs.GetInt("Highscore");
        //orignalWidth = Screen.width;
        //orignalHeight = Screen.height;
        // Saving Score if user goes into main menu while playing game.
        Debug.Log("check from main menu to asking to save score " + EventTalk.EventTrigger.askToSaveScore);
        if (EventTalk.EventTrigger.askToSaveScore == true)
        {
            //  publicService.SubmitScoreToLeaderBoards ();
            LaserMove.Save();
        }
    }
예제 #8
0
    public void Strike(LaserMove laser)
    {
        Destroy(laser.gameObject);

        LaserMove l1 = ((GameObject)Instantiate(laser.gameObject)).GetComponent <LaserMove>();

        l1.Direction = laser.Direction.RotateLeft();
        l1.Colour    = new Color(laser.Colour.r, 0, 0);
        l1.Move();


        LaserMove l2 = ((GameObject)Instantiate(laser.gameObject)).GetComponent <LaserMove>();

        l2.Direction = laser.Direction;
        l2.Colour    = new Color(0, laser.Colour.g, 0);
        l2.Move();


        LaserMove l3 = ((GameObject)Instantiate(laser.gameObject)).GetComponent <LaserMove>();

        l3.Direction = laser.Direction.RotateRight();
        l3.Colour    = new Color(0, 0, laser.Colour.b);
        l3.Move();

        if (GetEnergy(l1) < 0.2f)
        {
            Destroy(l1.gameObject);
        }
        if (GetEnergy(l2) < 0.2f)
        {
            Destroy(l2.gameObject);
        }
        if (GetEnergy(l3) < 0.2f)
        {
            Destroy(l3.gameObject);
        }
    }
예제 #9
0
 public void Strike(LaserMove laser)
 {
     Destroy(laser.gameObject);
 }
예제 #10
0
 public void Strike(LaserMove laser)
 {
     Destroy(laser.gameObject);
 }
예제 #11
0
    void OnGUI()
    {
        GUI.skin = skins;
        //Scaling GUI MATRIX FOR ALL RESOLUTION
        scale.x = Screen.width / 320.0f;
        scale.z = Screen.height / 480.0f;
        scale.y = 1f;
        var svMat = GUI.matrix;

        Debug.Log(Screen.width.ToString());
        Debug.Log(Screen.height.ToString());
        Debug.Log(scale.x.ToString());
        Debug.Log(scale.z.ToString());
        GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, scale);

        GUI.Box(new Rect(0, Screen.height - 70, Screen.width, 70), "", noGUIStyle);
        GUI.Label(new Rect(5, Screen.height - 60, 400, 100), " Score  " + score.ToString());
        GUI.Label(new Rect(5, Screen.height - 40, 400, 100), " HighScore   " + high);
        GUI.Box(new Rect(170, Screen.height - 70, Screen.width, 70), "", noGUIStyle);
        GUI.Label(new Rect(180, Screen.height - 60, 100, 100), " Lives  x" + " " + PlayerLive);
        //GUI.DrawTexture(new Rect(270,Screen.height - 60,50,25),lives[PlayerLive]);


        if (finishedLevel)
        {
            if (scrChecker >= 1)
            {
                finishedLevel = false;
            }
            else
            {
                finishedLevel  = false;
                Time.timeScale = 0;
                //BridgeJTOC.Bridge.setScore(score);
                //BridgeJTOC.Bridge.setKill(killCounter);
                Instantiate(HighScore, transform.position, transform.rotation);
                Destroy(pauseButton);
                scrChecker++;
                LaserMove.Save();
            }
        }
        if (gameOver == true)
        {
            LaserMove.Save();
            AutoFade.LoadLevel("GameOver", 1, 1, Color.red);
            fbFeed();
        }
        if (Application.platform == RuntimePlatform.Android)
        {
            if (Input.GetKeyUp(KeyCode.Escape))
            {
                publicService.SubmitScoreToLeaderBoards();
                fbCheck();
                // FB.Logout ();
                LaserMove.Save();


                Instantiate(AlertBoxPrefeb, transform.position, transform.rotation);
                //return;
            }
        }
        GUI.matrix = svMat;
    }
예제 #12
0
 private float GetEnergy(LaserMove l1)
 {
     return(l1.Colour.r + l1.Colour.g + l1.Colour.b);
 }
예제 #13
0
 public void Strike(LaserMove laser)
 {
 }
예제 #14
0
 public void Strike(LaserMove laser)
 {
 }