コード例 #1
0
    void Start()
    {
        doorTransform = transform.Find("Door");
        progressBar   = GetComponentInChildren <Image>();

        hyperSpeedManager = HyperSpeedManager.Instance;

        // save the closed and open y positions
        closedY = doorTransform.position.y;
        float height = doorTransform.GetComponent <Renderer>().bounds.extents.y * 2.0f; // gets height of door in world units

        openY = closedY + height * 0.8f;

        // subscribe to the button events
        if (button != null)
        {
            button.OnActivate += SetToOpening;
        }
        if (button != null)
        {
            button.OnDeactivate += SetToClosing;
        }

        targetY = closedY;
    }
コード例 #2
0
    private void Start()
    {
        hyperSpeedManager = HyperSpeedManager.Instance;
        particleSystem    = GetComponent <ParticleSystem>();

        // Store default sim speed to preserve sim tweaks in the inspector
        defaultSimSpeed     = particleSystem.main.simulationSpeed;
        defaultEmissionRate = particleSystem.emission.rateOverTimeMultiplier;
    }
コード例 #3
0
    void Start()
    {
        hyperSpeedManager = HyperSpeedManager.Instance;
        textBox           = gameObject.GetComponentInChildren <Text>();

        // load in the text file and split it into an array of strings based on the lines in the file
        if (textFile != null)
        {
            textLines = (textFile.text.Split('\n'));
        }

        runningCoroutine = StartCoroutine(playText());
    }
コード例 #4
0
    void Start()
    {
        posA        = child.localPosition;
        posB        = transformB.localPosition;
        nextPos     = posB;
        progressBar = GetComponentInChildren <Image>();

        hyperSpeedManager = HyperSpeedManager.Instance;

        // subscribe to the button events
        button.OnActivate   += SetToOpening;
        button.OnDeactivate += SetToClosing;
    }
コード例 #5
0
    }                                                              // static singleton

    private void Awake()
    {
        // If there are no instances of HyperSpeedManager, set this to be the instance
        if (Instance == null)
        {
            Instance = this;
        }
        // else destroy this instance, so that can only be one instances
        else
        {
            Destroy(gameObject);
        }
    }
コード例 #6
0
 void Start()
 {
     posA              = child.localPosition;
     posB              = transformB.localPosition;
     nextPos           = posB;
     hyperSpeedManager = HyperSpeedManager.Instance;
     if (phase < 1)
     {
         child.localPosition = Vector3.Lerp(posA, posB, phase);
     }
     else
     {
         child.localPosition = Vector3.Lerp(posB, posA, phase - 1);
     }
 }
コード例 #7
0
 // Start is called before the first frame update
 void Start()
 {
     hyperSpeedManager = HyperSpeedManager.Instance;
 }
コード例 #8
0
 void Start()
 {
     hyperSpeedManager = HyperSpeedManager.Instance;
     postProcessVolume = GetComponent <PostProcessVolume>();
 }
コード例 #9
0
 private void Start()
 {
     hyperSpeedManager = HyperSpeedManager.Instance;
     particleSystem    = GetComponent <ParticleSystem>();
     defaultSimSpeed   = particleSystem.main.simulationSpeed;
 }