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>(); }
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); //} }
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>(); }
void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; }
private void Awake() { if (Instance) { Destroy(this); return; } Instance = this; source = GetComponent <AudioSource>(); }
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"); }
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.
public Facade() { computer = new Computer(); screen = new Screen(); soundBox = new SoundBox(); }