Inheritance: MonoBehaviour
コード例 #1
0
    // Use this for initialization
    void Start()
    {
        TotalCoinsText.text = PlayerPrefs.GetInt("TotalCoins").ToString();

        cameraScroll = cam.GetComponent <CameraScroll>();
        pauseLevel   = UIManager.GetComponent <PauseLevel>();
        timerScript  = UIManager.GetComponent <TimerScript>();
        //advertismentScript = UIManager.GetComponent<AdvertisementScript>();
        muteAudio            = UIManager.GetComponent <MuteAudio>();
        levelCharacteristics = UIManager.GetComponent <LevelCharacteristics>();

        if (levelCharacteristics.isGravitySwitch)
        {
            jumpDirection = Vector2.left;
            levelCharacteristics.GravitySwitch();
        }



        coinArray      = GameObject.FindGameObjectsWithTag("Coin");
        coinListLength = coinArray.Length;
        for (int x = 0; x < coinListLength; x++)
        {
            coinList.Add(coinArray[x]);
        }



        playerPosition = player.transform.position; camPosition = cam.transform.position;
        music.Pause();
    }
コード例 #2
0
ファイル: OptionsScreen.cs プロジェクト: MK4H/MHUrho
            public override void Dispose()
            {
                UnitDrawDistance.ValueChanged       -= UnitDrawDistanceChanged;
                ProjectileDrawDistance.ValueChanged -= ProjectileDrawDistanceChanged;
                TerrainDrawDistance.ValueChanged    -= TerrainDrawDistanceChanged;
                CameraScroll.ValueChanged           -= CameraScrollChanged;
                CameraRotation.ValueChanged         -= CameraRotationChanged;
                MouseCamRotation.ValueChanged       -= MouseCamRotationChanged;
                ZoomSpeed.ValueChanged   -= ZoomSpeedChanged;
                Resolutions.ItemSelected -= ResolutionSelected;
                WindowTypes.ItemSelected -= WindowTypeSelected;
                HighDPI.Toggled          -= HighDPIToggled;
                TripleBuffer.Toggled     -= TripleBufferToggled;
                VSync.Toggled            -= VSyncToggled;
                DebugHUD.Toggled         -= DebugHUDToggled;
                BorderMovement.Toggled   -= BorderMovementToggled;
                PathFindingVisualization.ItemSelected -= PathFindingVisualizationSelected;

                UnitDrawDistance.Dispose();
                ProjectileDrawDistance.Dispose();
                TerrainDrawDistance.Dispose();

                CameraScroll.Dispose();
                CameraRotation.Dispose();
                MouseCamRotation.Dispose();
                ZoomSpeed.Dispose();

                window.RemoveAllChildren();
                window.Remove();
                window.Dispose();
            }
コード例 #3
0
    //Vector3 posOnScreen;

    private void Start()
    {
        cameraScroller = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraScroll>();
        gm             = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManagerScript>();
        rb             = GetComponent <Rigidbody>();
        bounds         = GetComponent <BoundsManager>();
    }
コード例 #4
0
 void Update()
 {
     swipe = null;
     if (Input.GetMouseButtonDown(0))
     {
         down  = true;
         start = Camera.main.ScreenToWorldPoint(Input.mousePosition);
     }
     if (Input.GetMouseButtonUp(0))
     {
         down  = false;
         timer = 0f;
         end   = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         SceneChanger sc = GameObject.FindGameObjectWithTag("UI")?.GetComponent <SceneChanger>();
         CameraScroll cs = GameObject.FindGameObjectWithTag("MainCamera")?.GetComponent <CameraScroll>();
         if (timer < maxDuration && (end - start).magnitude > 0.1f &&
             (sc == null || !sc.openUI) && (cs == null || !cs.scrolling))
         {
             swipe = new Swipe(start, end);
         }
     }
     // keep track of swipe duration
     if (down)
     {
         timer += Time.deltaTime;
     }
 }
コード例 #5
0
 CameraScroll cameraScrollInit()
 {
     cameraScroll = new CameraScroll();
     cameraScroll.SetMouse(Mouse);
     cameraScroll.SetCameraMovementController(this);
     return(cameraScroll);
 }
コード例 #6
0
ファイル: TouchScript.cs プロジェクト: johnli1/2-Tunnels
    void Start()
    {
        scrollRef = Camera.main.GetComponent <CameraScroll>();

        finger1GO = GameObject.FindGameObjectWithTag("Finger1");
        finger2GO = GameObject.FindGameObjectWithTag("Finger2");

        finger1GO.SetActive(false);
        finger2GO.SetActive(false);
    }
コード例 #7
0
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
         Debug.LogError("Duplicate instances of '" + this.GetType().ToString() + "'. Bug?");
     }
     else
     {
         instance = this;
     }
 }
コード例 #8
0
    public void trigger()
    {
        CameraScroll cam = Camera.main.GetComponent <CameraScroll>();

        cam.lockCamera();
        center  = cam.endPos;
        _player = FindObjectOfType <PhysicalPlayerController>();
        cam.move(_player.tf, new Vector2(0.2f, 0.2f), 1.5f);
        common.TimerManager.instance.addEventListeners(this);

        closerTrigger();
    }
コード例 #9
0
    void Start()
    {
        Rigidbody rb = GetComponent <Rigidbody>();

        if (rb)
        {
            rb.freezeRotation = true;
        }
        originalRotation = transform.localRotation;

        CameraStrollInstance = GetComponent <CameraScroll>();
    }
コード例 #10
0
    void Start()
    {
        ScreenWidth     = Screen.width;
        ScreenHeight    = Screen.height;
        GamePlaneBounds = GameObject.Find("Plane").GetComponent <PlaneBoundry>().GamePlaneBounds;

        CameraOrthographicSize = ScrollWheelLimit.y / 6;
        Mouse = GetComponent <MouseBoundry>();

        cameraMovement = cameraMovementInit();
        cameraScroll   = cameraScrollInit();
    }
コード例 #11
0
    public void trigger()
    {
        a       = 1.5f * initSpeedX;
        delta.x = -initSpeedX;
        delta.y = -initspeedY;
        CameraScroll cam = Camera.main.GetComponent <CameraScroll>();

        cam.lockCamera();
        _player = FindObjectOfType <PhysicalPlayerController>();
        cam.move(_player.tf, new Vector2(0.2f, 0.2f), 1.5f);
        common.TimerManager.instance.addEventListeners(this);
        closerTrigger();
    }
コード例 #12
0
    void Start()
    {
        cam = Camera.main.GetComponent <CameraScroll>();
        if (ani != null)
        {
            CharacterAnimation newAni = tf.gameObject.AddComponent <CharacterAnimation>();
            newAni.copy(ani);
            ani = newAni;
            ani.addSprToDic();
        }

        rb.gravityScale = 0;
        Setting s = GlobalController.instance.setting;

        if (GlobalController.instance.curScene.underWater)
        {
            _gravityScale = 0;
            _upSpeed      = s.waterUpSpeed;
            _moveSpeed    = s.waterMoveSpeed;
            jumpHandler   = waterUpHandler;
        }
        else
        {
            _gravityScale = s.playerG / s.g;
            _upSpeed      = s.smallUpSpeed;
            _moveSpeed    = s.moveSpeed;
            jumpHandler   = spaceJumpHandler;
        }

        col        = tf.GetComponent <BoxCollider2D>();
        col.size   = s.roleColliderSize;
        col.offset = new Vector2(0, col.size.y * 0.5f);
        height     = col.size.y * 0.9f;


        reboundReleaseDelay = new WaitForSeconds(s.reboundProtectTime);

        ani.play(Config.CharcterAction.Idle);
        _lockPosture = true;
        initScaleX   = Mathf.Abs(transform.lossyScale.x);

        _lastPostion = tf.position;


        bulletData       = new BulletData();
        bulletData.speed = GlobalController.instance.setting.bigUpSpeed;

        AwakeManager.instance.addEventListener(this);
    }
コード例 #13
0
 // Use this for initialization
 void Start()
 {
     if (GlobalState.SharedPassQuest != 1)
     {
         base.mobile = InitMobileGUI.InitMobileGUIObject(false);
     }
     else
     {
         base.mobile = InitMobileGUI.InitMobileGUIObject(true);
         CameraScroll cam = sceneCamera.GetComponent <CameraScroll>();
         cam.scroll_min = minScroll;
         cam.scroll_max = maxScroll;
         sceneCamera.transform.localPosition = new Vector3(x, y, sceneCamera.transform.localPosition.z);
     }
 }
コード例 #14
0
ファイル: CameraOrbitMax.cs プロジェクト: vinfamy/LLCF
    // Use this for initialization
    void Start()
    {
        Vector3 angles = transform.eulerAngles;

        x = angles.y;
        y = angles.x;

        rigidbody = GetComponent <Rigidbody>();

        // Make the rigid body not change rotation
        if (rigidbody != null)
        {
            rigidbody.freezeRotation = true;
        }

        CameraStrollInstance = MainCamera.GetComponent <CameraScroll>();
    }
コード例 #15
0
    /// <summary>
    /// move the camera
    /// </summary>
    private void moveCamera()
    {
        CameraScroll cam = sceneCamera.GetComponent <CameraScroll>();

        cam.scroll_min = minScroll;
        cam.scroll_max = maxScroll;
        sceneCamera.transform.localPosition = new Vector3(x, y, sceneCamera.transform.localPosition.z);

        if (throwMyDialog)
        {
            ThrowDialog t = this.gameObject.GetComponent <ThrowDialog>();
            if (t)
            {
                t.ThrowDialogNow();
            }
        }
    }
コード例 #16
0
ファイル: GameSwitcher.cs プロジェクト: gualt1995/EVIJV
    void Start()
    {
        BannerText = GameObject.Find("TextWarining");

        Mcam = GameObject.Find("MapCamera");
        Scam = GameObject.Find("ShipCamera");
        Ecam = GameObject.Find("SearchCamera");
        Acam = GameObject.Find("AnomalyCamera");

        cameraScroll    = Mcam.GetComponent <CameraScroll>();
        PlayerAsteroids = GameObject.Find("PlayerAsteroids");
        PlayerSearch    = GameObject.Find("PlayerSearch");

        Adgc = GameObject.Find("AGameController").GetComponent <Done_GameController>();
        Sdgc = GameObject.Find("SgameController").GetComponent <SgameController>();


        ReturnToSpace();
        Search();
    }
コード例 #17
0
ファイル: LevelGenerator.cs プロジェクト: EinarBalan/Rolling
 // Use this for initialization
 void Start()
 {
     prefabs                = Resources.LoadAll <GameObject>("Prefabs");
     cameraScroll           = Camera.main.GetComponent <CameraScroll>();
     levelGeneratorPlatform = environment01.GetComponent <LevelGeneratorPlatform>();
 }
コード例 #18
0
 // Use this for initialization
 void Start()
 {
     cameraScroll = cam.GetComponent <CameraScroll>();
     pauseLevel   = UIManager.GetComponent <PauseLevel>();
 }
コード例 #19
0
 void Awake()
 {
     main = this;
 }
コード例 #20
0
 void Awake()
 {
     main               = this;
     currentVelocity    = defaultVelocity;
     transform.rotation = Quaternion.Euler(pitch, yaw, 0);
 }
コード例 #21
0
 // Use this for initialization
 void Start()
 {
     cameraScroll = FindObjectOfType <CameraScroll>();
 }
コード例 #22
0
 private void Start()
 {
     cameraSpeed = GetComponentInParent <CameraScroll>();
 }
コード例 #23
0
ファイル: PauseLevel.cs プロジェクト: EinarBalan/Rolling
 // Use this for initialization
 void Start()
 {
     cameraScroll = cam.GetComponent <CameraScroll>();
     music        = player.GetComponent <AudioSource>();
     playerScript = player.GetComponent <PlayerScript>();
 }
コード例 #24
0
 void LoadGUI(Scene scene, LoadSceneMode mode)
 {
     cameraScroll     = GameObject.Find("Main Camera").GetComponent <CameraScroll>();
     DialogController = GameObject.Find("DialogController");
     MagicMeter       = GameObject.Find("MagicMeter").GetComponent <MagicMeter>();
 }
コード例 #25
0
 void Awake()
 {
     example = this;
 }