コード例 #1
0
ファイル: VCam.cs プロジェクト: oscarmore2/SspUnityPlugin
    public static VCam Create(string url, GameObject o)
    {
        var s   = InputSourceProvider.Create(url, o);
        var cam = new VCam(s);

        return(cam);
    }
コード例 #2
0
    public void BindVcam(VCam vcam, VCamView view, Rect rect)
    {
        var source  = (InputSource)vcam.source;
        var surface = source.CreateSurface(rect);

        VCamIViewDictionary[vcam] = view;
        view.SetSurface(surface);
        source.Begin();
    }
コード例 #3
0
        private void Awake()
        {
            VCam         = GetComponent <CinemachineVirtualCamera>();
            UnityCamera  = Camera.main;
            POVComponent = VCam.GetCinemachineComponent <CinemachinePOV>();

            horizontalAxisName = POVComponent.m_HorizontalAxis.m_InputAxisName;
            verticalAxisName   = POVComponent.m_VerticalAxis.m_InputAxisName;

            // Disable POV Module or we might start partially in the wrong state.
            TogglePOV(false);
        }
コード例 #4
0
ファイル: Player.cs プロジェクト: shaneh22/myprojects
 private void InitGame()
 {
     healthText   = GameObject.Find("HealthText").GetComponent <TMP_Text>();
     lifeChanged  = GameObject.Find("LifeChanged").GetComponent <ParticleSystem>();
     coinsText    = GameObject.Find("CoinsText").GetComponent <TMP_Text>();
     coinsChanged = GameObject.Find("CoinChanged").GetComponent <ParticleSystem>();
     vCam         = FindObjectOfType <VCam>();
     SetHealthText();
     _         = StartCoroutine(LastGroundedPosition());
     winScreen = GameObject.Find("WinScreen");
     winScreen.SetActive(false);
 }
コード例 #5
0
 void Awake()
 {
     if (Instance != null)
     {
         Destroy(this.gameObject);
         return;
     }
     Instance = this;
     GameObject.DontDestroyOnLoad(this.gameObject);
     vCam     = GetComponent <CinemachineVirtualCamera>();
     confiner = GetComponent <CinemachineConfiner>();
     princess = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>();
 }
コード例 #6
0
ファイル: Player.cs プロジェクト: shaneh22/myprojects
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);

        rb   = GetComponent <Rigidbody2D>();
        anim = GetComponent <Animator>();
        sword.SetActive(false);

        jumps    = numJumps; //set the number of extra jumps, currently at 1. (double jump)
        controls = new PlayerControls();

        controls.Gameplay.Move.performed += ctx => move = ctx.ReadValue <float>();
        controls.Gameplay.Move.canceled  += ctx => move = 0;

        controls.Gameplay.Jump.performed += ctx => Jump();
        controls.Gameplay.Jump.canceled  += ctx => CancelJump();

        controls.Gameplay.Dash.performed += ctx => Dash();

        controls.Gameplay.Attack.performed += ctx => Attack();

        vCam = FindObjectOfType <VCam>();
        controls.Gameplay.LookDown.performed += ctx => LookDown();
        controls.Gameplay.LookDown.canceled  += ctx => ResetCamera();

        healthText  = GameObject.Find("HealthText").GetComponent <TMP_Text>();
        lifeChanged = GameObject.Find("LifeChanged").GetComponent <ParticleSystem>();

        coinsText    = GameObject.Find("CoinsText").GetComponent <TMP_Text>();
        coinsChanged = GameObject.Find("CoinChanged").GetComponent <ParticleSystem>();

        healthText.text = maxLives + "";

        _ = StartCoroutine(LastGroundedPosition());

        startingTime = DateTime.Now;

        winScreen = GameObject.Find("WinScreen");
        winScreen.SetActive(false);
    }
コード例 #7
0
    public bool GetVcamByView(IView view, ref VCam vcam)
    {
        if (!VCamIViewDictionary.ContainsValue(view))
        {
            return(false);
        }

        foreach (var kp in VCamIViewDictionary)
        {
            if (kp.Value == view)
            {
                vcam = kp.Key;
                return(true);
            }
        }
        return(false);
    }
コード例 #8
0
    public void LoadConfig()
    {
        config = new Configuration(System.IO.Path.Combine(Application.streamingAssetsPath, "config/StreamSetting.ini"));

        if (config == null)
        {
            SetDefaultConfig();
            return;
        }

        foreach (var key in config["Input"])
        {
            if (key.KeyName.Contains("url"))
            {
                InputSource source = new InputSource(key.Value);
                source.CreateSurface(new Rect(1, 1, 1, 1));
                VCam v = new VCam(source);
                Add(v);
            }
        }
    }
コード例 #9
0
        public override void InitState()
        {
            VAssImpImp.IPath = "c:/med/";
            ER = new VEnvRenderer(512, 512);
            PR = new VPostProcessRenderer(512, 512);
            // PR.Add(new VPPBlur());
            sg       = new VSceneGraph();
            PR.Scene = sg;
            ER.Scene = sg;

            e1            = VImport.ImportNode("c:/Media/dwarf2.b3d"); //file of 3d model to load.
            e1.LocalScale = new Vector3(1, 1, 1);

            var m1 = new VMaterial();

            m1.TCol = new VTex2D("c:/Media/tex1_c.png", LoadMethod.Single); // texture to load
            m1.TEnv = VTextureUtil.LoadCubeMap("c:/Media/cm1.png.cube");    // cubemap to load. use cubeconvert to convert.
            //m2.TEnv = ER.FB.Cube;
            var ee = e1 as VSceneEntity;

            //var ee2 = e2 as VSceneEntity; //building project atm.
            SetMat(ee, m1);

            // SetMat(ee2, m2);
            sg.Add(e1);
            // sg.Add(e2);

            c1 = new VCam();
            sg.Add(c1);
            l1 = new VLight();
            l1.Pos(new Vector3(0, 40, 0), Space.Local);
            c1.Pos(new Vector3(0, 0, 300), Space.Local);
            c1.LookAt(Vector3.Zero, new Vector3(0, 1, 0));
            sg.Add(l1);
            //e1.Pos(new Vector3(0, -30, 0), Space.Local);
            // e2.Pos(new Vector3(0, 20, 0), Space.Local);
        }
コード例 #10
0
 public IView GetViewByVcam(VCam cam)
 {
     return(VCamIViewDictionary[cam]);
 }
コード例 #11
0
 public void Add(VCam v)
 {
     Cam.Add(v);
 }
コード例 #12
0
ファイル: Enemy.cs プロジェクト: shaneh22/myprojects
 private void Start()
 {
     vCam = FindObjectOfType <VCam>();
 }
コード例 #13
0
    private VCam m_VCamScript;              // VirtualCameraのスクリプト

    // Start is called before the first frame update
    void Start()
    {
        // 生成されたオクトのクローンのスクリプト
        m_OctoScript = GameObject.FindWithTag("PlayerCharacter").GetComponent <OctoStartMove>();
        m_VCamScript = GameObject.FindWithTag("VCamera").GetComponentInChildren <VCam>();
    }
コード例 #14
0
 public VCamController(VCam c)
 {
     cam = c;
 }