コード例 #1
0
        new protected void OnTriggerExit(Collider col)
        {
            HydrogenFilter filter = col.gameObject.GetComponentInParent <HydrogenFilter>();

            if (filter)
            {
                if (filter.type == filterType)
                {
                    base.OnTriggerExit(col);
                }
            }
        }
コード例 #2
0
        public HydrogenFilterSocketProblems PowerOn(bool silent = false)
        {
            if (silent)
            {
                isOn = true;
                return(HydrogenFilterSocketProblems.NoProblem);
            }

            // Checking for problems
            var problem = HydrogenFilterSocketProblems.FilterMissing;

            if (selectTarget)
            {
                HydrogenFilter filter = selectTarget.GetComponent <HydrogenFilter>();
                if (filter.isInGoodCondition)
                {
                    problem = HydrogenFilterSocketProblems.NoProblem;
                }
                else
                {
                    problem = HydrogenFilterSocketProblems.FilterInBadCondition;
                }
            }

            // Problem feedback
            if (problem != HydrogenFilterSocketProblems.NoProblem)
            {
                switch (problem)
                {
                case HydrogenFilterSocketProblems.FilterInBadCondition:
                    troubleParticles.Play(true);
                    break;

                case HydrogenFilterSocketProblems.FilterMissing:
                    leakageParticles.Play(true);
                    break;
                }
                troubleAudio.volume = 1f;
                troubleAudio.Play();
            }

            isOn = true;
            return(problem);
        }