Пример #1
0
 void OnEnable()
 {
     propMode          = serializedObject.FindProperty("_mode");
     propOrigin        = serializedObject.FindProperty("_origin");
     propDirection     = serializedObject.FindProperty("_direction");
     propBaseColor     = serializedObject.FindProperty("_baseColor");
     propWaveColor     = serializedObject.FindProperty("_waveColor");
     propWaveAmplitude = serializedObject.FindProperty("_waveAmplitude");
     propWaveExponent  = serializedObject.FindProperty("_waveExponent");
     propWaveInterval  = serializedObject.FindProperty("_waveInterval");
     propWaveSpeed     = serializedObject.FindProperty("_waveSpeed");
     propAddColor      = serializedObject.FindProperty("_addColor");
     propDuration      = serializedObject.FindProperty("_duration");
     targetObject      = serializedObject.targetObject as SonarFx;
 }
Пример #2
0
    private void Awake()
    {
        ground       = GetComponent <GroundDetector>();
        interact     = GetComponent <InteractableDetector>();
        rigidbody    = GetComponent <Rigidbody>();
        bodyCollider = GetComponent <CapsuleCollider>();
        sonar        = GetComponent <SonarFx>();
        sonarTimer   = new Timer();

        interact.OnDetectionEnter.AddListener(OnDetectionRaise);
        interact.OnDetectionExit.AddListener(OnDetectionQuit);
        crouchPercentage   = crouchHeight / bodyCollider.height;
        origColliderHeight = bodyCollider.height;
        origColliderCenter = bodyCollider.center;
        origCameraPivotPos = cameraPivot.localPosition;

        ground.OnTouchGround += _onTouchGround;
        ground.OnLeaveGround += _onLeaveGround;
    }
Пример #3
0
 void Start()
 {
     SNFX = GetComponent<SonarFx>();
 }
Пример #4
0
 void Awake()
 {
     fx = GetComponent<SonarFx>();
 }
Пример #5
0
 void Awake()
 {
     fx = GetComponent <SonarFx>();
 }
Пример #6
0
 // Start is called before the first frame update
 void Start()
 {
     sonar = gameObject.GetComponent <SonarFx>();
 }
Пример #7
0
 // Use this for initialization
 void Awake()
 {
     sonar         = GetComponent <SonarFx>();
     sonar.enabled = false;
 }
Пример #8
0
        void DoSonarFx()
        {
            var go = Fsm.GetOwnerDefaultTarget(cameraOwner);

            if (go == null)
            {
                return;
            }

            if (go != previousGo)
            {
                sonar      = go.GetComponent <SonarFx>();
                previousGo = go;
            }

            if (sonar == null)
            {
                return;
            }

            alaMode = sonarMode.ToString();


            if (string.Equals(alaMode.Value, daMode))
            {
                sonar.mode          = SonarFx.SonarMode.Directional;
                sonar.direction     = direction.Value;
                sonar.waveColor     = color.Value;
                sonar.baseColor     = albedo.Value;
                sonar.addColor      = emission.Value;
                sonar.waveAmplitude = amplitude.Value;
                sonar.waveExponent  = exponent.Value;
                sonar.waveInterval  = interval.Value;
                sonar.waveSpeed     = speed.Value;
                sonar.enabled       = enabled.Value;

                //var go2 = Fsm.GetOwnerDefaultTarget(cameraOwner);
                if (UpdateCache(go))
                {
                    camera.cullingMask = ActionHelpers.LayerArrayToLayerMask(cullingMask, invertMask.Value);
                }
            }


            else
            {
                if (useGameObject.Value == true)
                {
                    sonar.origin        = originGameObject.Value.transform.position;
                    sonar.waveColor     = color.Value;
                    sonar.baseColor     = albedo.Value;
                    sonar.addColor      = emission.Value;
                    sonar.waveAmplitude = amplitude.Value;
                    sonar.waveExponent  = exponent.Value;
                    sonar.waveInterval  = interval.Value;
                    sonar.waveSpeed     = speed.Value;
                    sonar.enabled       = enabled.Value;
                    sonar.mode          = SonarFx.SonarMode.Spherical;

                    //var go2 = Fsm.GetOwnerDefaultTarget(cameraOwner);
                    if (UpdateCache(go))
                    {
                        camera.cullingMask = ActionHelpers.LayerArrayToLayerMask(cullingMask, invertMask.Value);
                    }
                }



                if (usePosition.Value == true)
                {
                    sonar.origin        = originPosition.Value;
                    sonar.waveColor     = color.Value;
                    sonar.baseColor     = albedo.Value;
                    sonar.addColor      = emission.Value;
                    sonar.waveAmplitude = amplitude.Value;
                    sonar.waveExponent  = exponent.Value;
                    sonar.waveInterval  = interval.Value;
                    sonar.waveSpeed     = speed.Value;
                    sonar.enabled       = enabled.Value;
                    sonar.mode          = SonarFx.SonarMode.Spherical;

                    //var go2 = Fsm.GetOwnerDefaultTarget(cameraOwner);
                    if (UpdateCache(go))
                    {
                        camera.cullingMask = ActionHelpers.LayerArrayToLayerMask(cullingMask, invertMask.Value);
                    }
                }
            }
        }