示例#1
0
    void Start()
    {
/*
 *      //make sure player is seeing ladders in correct world
 *      if (space)
 *      {
 *          GetComponent<MFPP.Modules.LadderModule>().LadderLayerMask.value = 262144; //only see ladders in real world
 *      }
 *      else { GetComponent<MFPP.Modules.LadderModule>().LadderLayerMask.value = 524288; //only see ladders in laser world
 *      }
 */

        //Debug.Log(Camera.main.fieldOfView);

        mutationSpawner = GetComponent <MutationSpawner>();
        audioSource     = GetComponent <AudioSource>();
        rm = GetComponent <RaycastManager>();
        SoundBox box = SoundBox.Instance;

        flipSounds         = box.currentFlipPalette;
        flipFailClip       = box.flipFail;
        soundTrack         = GetComponentInChildren <SoundTrackManager>();
        flipburst          = GetComponentInChildren <flipburst>();
        transitionCollider = GetComponentInChildren <TransitionCollider>();
        eyeThatSeesList    = new List <EyeThatSees>();
        _pickupModule      = GetComponent <MFPP.Modules.PickUpModule>();

        eyesEffect = Camera.main.GetComponent <ImageEffectEyes>();
    }
示例#2
0
    private void Awake()
    {
        // DontDestroyOnLoad(this.gameObject);

        Instance = this;


        //Todo: have it delete the old instance, earlier this was breaking it for some reason
        //{
        //    //Check if instance already exists
        //    if (instance == null)
        //    {
        //        //if not, set instance to this
        //        instance = this;
        //        DontDestroyOnLoad(this.gameObject);
        //        Debug.Log("I AM INTIATED");
        //    }


        //    //If instance already exists and it's not this:
        //    else if (instance != this)

        //        //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
        //        Destroy(gameObject);
        //}
    }
示例#3
0
 void Start()
 {
     wb = GameObject.Find("WorldBuilder").GetComponent <worldBuilder>();
     transform.position = GameObject.Find("0,0").transform.position;
     UI_C     = GameObject.Find("Canvas").transform.GetChild(0).gameObject.GetComponent <UIController>();
     soundbox = GameObject.Find("SoundCube").GetComponent <SoundBox>();
     ItemDB   = GameObject.Find("GameController").GetComponent <ItemDatabase>();
 }
示例#4
0
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
    }
示例#5
0
    private void Awake()
    {
        if (Instance)
        {
            Destroy(this);
            return;
        }

        Instance = this;
        source   = GetComponent <AudioSource>();
    }
示例#6
0
    private void Start()
    {
        player = Toolbox.Instance.GetPlayer();
        box    = SoundBox.Instance;
        pickUp = player.GetComponent <MFPP.Modules.PickUpModule>();


        partSystem = GetComponent <ParticleSystem>();

        if (partSystem)
        {
            partSystem.emission.SetBursts(new ParticleSystem.Burst[3]);
        }
    }
        public void Test()
        {
            Car car = new XiaomiCar();

            Decorator carWithBumper = new Bumper(car);

            carWithBumper.Show().ShouldBe("XiaomiCar+Bumper");

            Decorator carWithSoundBox = new SoundBox(car);

            carWithSoundBox.Show().ShouldBe("XiaomiCar+SoundBox");

            Decorator carWithBumperAndSoundBox = new SoundBox(carWithBumper);

            carWithBumperAndSoundBox.Show().ShouldBe("XiaomiCar+Bumper+SoundBox");
        }
示例#8
0
using UnityEngine;
using System.Collections;

namespace MFPP.Modules
{
    [HelpURL("https://ashkoredracson.github.io/MFPP/#pick-up-module")]

    [DisallowMultipleComponent]


    public class PickUpModule : PlayerModule
    {
        /// <summary>
        /// The maximum pickup distance.
        /// </summary>
        [Space]
        [Tooltip("The maximum pickup distance.")]
        public float MaxPickupDistance = 2f;
        public float breakDistance = 5f;
        public float maxVelocity = 12;

        [Tooltip("Pick up button.")]
        public string PickUpButton = "Pick Up";
        public Transform playerCam;
        public GameObject heldObject;
        public FootstepAsset originalFootstep;
        public FootstepAsset dragFootstep;
        public Rigidbody target;

        [SerializeField] private LayerMask newLayerMask;
        private Camera mainCamera;
        private float originalWalkingSpeed = 3;
        private IconContainer iconContainer;
        private AudioSource audioSource;
        private AudioClip pickupClip;
        private AudioClip dropClip;
        private AudioClip popClip;
        private float CurrentHeight;
        private float Radius;
        private IHoldable _holdable;
        private ISelectable _selectable;
        private ReticleObject _rObject;
        private RaycastManager rm;

        void Start () 
       {
            mainCamera = Camera.main;
            audioSource = GetComponent<AudioSource>();
            SoundBox sound = SoundBox.Instance;
            pickupClip = sound.pickup;
            popClip = sound.pop;
            dropClip = sound.deselect;
            iconContainer = Toolbox.Instance.GetIconContainer();
            CurrentHeight = GetComponent<MFPP.Player>().CurrentHeight;
            Radius = GetComponent<CharacterController>().radius;
            rm = GetComponent<RaycastManager>();
        }


        public override void AfterUpdate()
        {
            if (ControlManager.Instance.GetButtonDown("PickUp")) // If pick up button was pressed
            {
                if (target) // If we already have a target rigidbody, set it to null, thus dropping/throwing it.
                {PutDown();}
                else
                {PrepareForPickup();}
            }

            if (target) // If target is not null, move the target in front of the camera at max pickup distance.
示例#9
0
 public Facade()
 {
     computer = new Computer();
     screen   = new Screen();
     soundBox = new SoundBox();
 }