void Action()
    {
        print("Button Action");

        MB_Interactions isInteract = GetComponent <MB_Interactions>();

        isInteract.StopInteract();
    }
Esempio n. 2
0
    void Action()
    {
        print("Holdable Object Hold");

        this.transform.position = GetComponent <CameraController>().Target.transform.position;

        if (GameInputManager.GetKeyDown("EndHold"))
        {
            MB_Interactions isInteract = GetComponent <MB_Interactions>();
            isInteract.StopInteract();
        }
    }
    // DETECTION D'OBJETS AVEC INTERACTIONS POSSIBLES
    void InteractionDetection()
    {
        RaycastHit detect;
        Ray        ray = PlayerCamera.ScreenPointToRay(cameraCenter);

        if (Physics.Raycast(ray, out detect, 10000, LayerMask.GetMask("Interactions")))
        {
            print("Ray Detect");
            MB_Interactions detection = detect.collider.GetComponent <MB_Interactions>();
            detection.Detection();
        }
    }
    // ACTIVATION D'OBJETS AVEC INTERACTIONS
    void InteractionActivation()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            Ray        ray = PlayerCamera.ScreenPointToRay(Input.mousePosition);
            Debug.DrawRay(ray.origin, ray.direction);

            if (Physics.Raycast(ray, out hit, 10000, LayerMask.GetMask("Interactions")))
            {
                MB_Interactions interactions = hit.collider.GetComponent <MB_Interactions>();
                if (interactions != null)
                {
                    interactions.Interact();
                }
            }
        }
    }
Esempio n. 5
0
    void Action()
    {
        nbInteract += 1;

        if (nbInteract == 1)
        {
            SpaceshipController isInSpaceshipControlMode = GetComponent <SpaceshipController>();
            isInSpaceshipControlMode.SpaceshipStart();

            CameraController lockedSpaceshipControlCamera = GetComponent <CameraController>();
            lockedSpaceshipControlCamera.LockedSpaceshipControlCamera();

            //SpaceshipController.spaceshipInstance.SpaceshipStart();
            //CameraController.cameraInstance.LockedSpaceshipControlCamera();
        }

        if (nbInteract >= 2)
        {
            MB_Interactions isInteract = GetComponent <MB_Interactions>();
            isInteract.StopInteract();

            nbInteract = 0;
        }
    }