Пример #1
0
    public IEnumerator Wait()
    {
        if (showDebug)
        {
            Debug.Log(base.name + "Waiting for the sound to finish ");
        }
        yield return(new WaitForSecondsRealtime(currentAudioClipDuration));

        SignalScriptNode1 dustParticles = GetComponent <SignalScriptNode1>();

        if (dustParticles != null)
        {
            dustParticles.SendSignal(1f);
        }
    }
Пример #2
0
        private void Disconnect()
        {
            if (showDebug)
            {
                Debug.Log(base.name + " Disconnect ");
            }
            Circuit.Disconnect(this);
            SignalScriptNode1 component = GetComponent <SignalScriptNode1>();

            if (component != null)
            {
                component.SendSignal(2f);
            }
            Object.Destroy(springIn);
            Object.Destroy(springOut);
            ignoreSocketConnect = connectedSocket;
            connectedSocket     = null;
        }
Пример #3
0
    public void Crack(float impact, Vector3 pos)
    {
        float num = impact / unityImpact;

        if (num > compressTreshold)
        {
            num = (num - compressTreshold) / compressRatio + compressTreshold;
        }
        if (crack != null)
        {
            crack.PlayOneShot(pos, num);
        }
        if (audioCrack != null)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " Audio Crack Playing ");
            }
            SignalScriptNode1 component = GetComponent <SignalScriptNode1>();
            component.sendSignal.value = 1f;
        }
    }
Пример #4
0
 private void DoHit(HitType type, Vector3 position)
 {
     if (showDebug)
     {
         Debug.Log(base.name + " DoHit ");
     }
     foreach (GameObject poolObject in poolObjects)
     {
         if (!poolObject.activeSelf)
         {
             poolObject.transform.position = position;
             poolObject.SetActive(value: true);
             if (showDebug)
             {
                 Debug.Log(base.name + " Trying to send signal now ");
             }
             graphNode = GetComponent <SignalScriptNode1>();
             graphNode.SendSignal(1f);
             break;
         }
     }
 }
Пример #5
0
        private bool Connect(PowerSocket scan)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " Connect ");
            }
            SignalScriptNode1 component = GetComponent <SignalScriptNode1>();

            if (component != null)
            {
                component.SendSignal(1f);
            }
            if (!Circuit.Connect(this, scan))
            {
                ignoreSocketConnect = scan;
                return(false);
            }
            connectedSocket = scan;
            springIn        = Attach(scan, alignmentTransform.position + torque * alignmentTransform.forward, connectedSocket.transform.position + (torque + tensionDistance) * connectedSocket.transform.forward);
            springOut       = Attach(scan, alignmentTransform.position - torque * alignmentTransform.forward, connectedSocket.transform.position - (torque + tensionDistance / 2f) * connectedSocket.transform.forward);
            return(true);
        }