Process









How do I use Process
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PhotonNetwork.cs Copy
2505     internal static void RPC(PhotonView view, string methodName, PhotonPlayer targetPlayer, bool encrpyt, params object[] parameters)
2506     {
2507         if (!VerifyCanUseNetwork())
2508         {
2509             return;
2510         }
2511
2512         if (room == null)
2513         {
2514             Debug.LogWarning("Cannot send RPCs in Lobby, only processed locally");
2515             return;
2516         }
2517
2518         if (player == null)
2519         {
2520             Debug.LogError("Error; Sending RPC to player null! Aborted \"" + methodName + "\"");
2521         }
2522
2523         if (networkingPeer != null)
2524         {
2525             networkingPeer.RPC(view, methodName, targetPlayer, encrpyt, parameters);
2526         }
2527         else
2528         {
2529             Debug.LogWarning("Could not execute RPC " + methodName + ". Possible scene loading in progress?");
2530         }
2531     }
File name: VSCode.cs Copy
72         static string ProgramFilesx86()
73   {
74    if( 8 == IntPtr.Size
75     || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))
76    {
77     return Environment.GetEnvironmentVariable("ProgramFiles(x86)");
78    }
79
80    return Environment.GetEnvironmentVariable("ProgramFiles");
81   }
File name: VSCode.cs Copy
439         static void CallVSCode(string args)
440         {
441             System.Diagnostics.Process proc = new System.Diagnostics.Process();
442             if(!VSCodeExists(CodePath))
443             {
444              PrintNotFound(CodePath);
445              return;
446             }
447
448#if UNITY_EDITOR_OSX
449             proc.StartInfo.FileName = "open";
450
451             // Check the path to see if there is "Insiders"
452             if (CodePath.Contains("Insiders"))
453             {
454                 proc.StartInfo.Arguments = " -n -b \"com.microsoft.VSCodeInsiders\" --args " + args.Replace(@"\", @"\\");
455             }
456             else
457             {
458                 proc.StartInfo.Arguments = " -n -b \"com.microsoft.VSCode\" --args " + args.Replace(@"\", @"\\");
459             }
460
461             proc.StartInfo.UseShellExecute = false;
462#elif UNITY_EDITOR_WIN
463             proc.StartInfo.FileName = CodePath;
464          proc.StartInfo.Arguments = args;
465             proc.StartInfo.UseShellExecute = false;
466#else
467             proc.StartInfo.FileName = CodePath;
468          proc.StartInfo.Arguments = args.Replace(@"\", @"\\");
469             proc.StartInfo.UseShellExecute = false;
470#endif
471             proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
472             proc.StartInfo.CreateNoWindow = true;
473             proc.StartInfo.RedirectStandardOutput = true;
474             proc.Start();
475         }
File name: ButtonSkills.cs Copy
54         private void addClickListener(GameObject buttonSkill, Sprite enableSprite, Sprite disableSprite)
55         {
56             buttonSkill.AddComponent();
57             SkillClickListener skillClickListener = buttonSkill.AddComponent();
58             skillClickListener.setDrawables(enableSprite, disableSprite);
59             skillClickListener.setEnabled(true);
60
61
62         }
File name: BoardLevel.cs Copy
62     private void addClickListener(GameObject bgObject, int levelIndex)
63     {
64         bgObject.AddComponent();
65         LevelClickListener clickListener = bgObject.AddComponent();
66         clickListener.levelIndex = levelIndex;
67         clickListener.boardLevel = gameObject;
68     }
File name: Maps.cs Copy
25         void Start()
26         {
27             int world = Data.getData(Data.KEY_WORLD_MAP);
28
29             for (int i = 0; i < 4; i++)
30             {
31                 if (i >= world)
32                 {
33                     mapObjects[i].GetComponent().sprite = lockSprites[i - 1];
34                 }
35                 else
36                 {
37                     mapObjects[i].GetComponent().sprite = mapSprites[i];
38                     mapObjects[i].AddComponent();
39                     WorldMapClickListener mapClick = mapObjects[i].AddComponent();
40                     mapClick.mapIndex = i;
41                 }
42             }
43
44             current = world - 1;
45             isUpdate = true;
46             transform.localPosition = new Vector3(-current * 8, transform.localPosition.y, transform.localPosition.z);
47
48             ARController.setBannerVisible(true);
49         }
File name: PickLayer.cs Copy
55     private void addSkillClickListener(GameObject skillObject, int skillIndex, SkillDescription skillDes, Descriptions descriptions, int starUnlock)
56     {
57         skillObject.AddComponent();
58         SkillClickListener skillClickListemer = skillObject.AddComponent();
59         skillClickListemer.skillIndex = skillIndex;
60         skillClickListemer.skillDescription = skillDes;
61         skillClickListemer.descriptions = descriptions;
62         skillClickListemer.starUnlock = starUnlock;
63         skillClickListemer.circleChoosed = circleChoosed;
64     }
File name: TemporalAction.cs Copy
22     public override bool Act(float delta)
23     {
24         if (complete) return true;
25
26         try
27         {
28             if (!began)
29             {
30                 begin();
31                 began = true;
32             }
33             time += delta;
34             complete = time >= duration;
35             if (complete) percent = 1;
36             else
37             {
38                 percent = time / duration;
39                 if (interpolationProcess != null) percent = interpolationProcess.apply(percent);
40             }
41             //UpdateAction(reverse ? 1 - percent : percent);
42             UpdateAction(percent);
43             if (complete) {
44                 end();
45             }
46             return complete;
47         }
48         finally {
49             //return false;
50         }
51     }
File name: TemporalAction.cs Copy
64     public void SetInterpolation(Interpolation interpolation)
65     {
66         this.interpolationProcess = InterpolationProcess.createInterpolation(interpolation);
67     }
File name: InterpolationProcess.cs Copy
12     public static InterpolationProcess createInterpolation(Interpolation interpolation)
13     {
14         InterpolationProcess process = null;
15         switch (interpolation)
16         {
17             case Interpolation.pow2:
18                 process = new InterpolationPow(2);
19                 break;
20             case Interpolation.pow3:
21                 process = new InterpolationPow(3);
22                 break;
23             case Interpolation.pow4:
24                 process = new InterpolationPow(4);
25                 break;
26             case Interpolation.pow5:
27                 process = new InterpolationPow(5);
28                 break;
29             case Interpolation.powIn2:
30                 process = new InterpolationPowIn(2);
31                 break;
32             case Interpolation.powIn3:
33                 process = new InterpolationPowIn(3);
34                 break;
35             case Interpolation.powIn4:
36                 process = new InterpolationPowIn(4);
37                 break;
38             case Interpolation.powIn5:
39                 process = new InterpolationPowIn(5);
40                 break;
41             case Interpolation.powOut2:
42                 process = new InterpolationPowOut(2);
43                 break;
44             case Interpolation.powOut3:
45                 process = new InterpolationPowOut(3);
46                 break;
47             case Interpolation.powOut4:
48                 process = new InterpolationPowOut(4);
49                 break;
50             case Interpolation.powOut5:
51                 process = new InterpolationPowOut(5);
52                 break;
53             case Interpolation.sine:
54                 process = new InterpolationSine();
55                 break;
56             case Interpolation.sineIn:
57                 process = new InterpolationSineIn();
58                 break;
59             case Interpolation.sineOut:
60                 process = new InterpolationSineOut();
61                 break;
62             case Interpolation.exp10:
63                 process = new InterpolationExp(2, 10);
64                 break;
65             case Interpolation.exp10In:
66                 process = new InterpolationExpIn(2, 10);
67                 break;
68             case Interpolation.exp10Out:
69                 process = new InterpolationExpOut(2, 10);
70                 break;
71             case Interpolation.exp5:
72                 process = new InterpolationExp(2, 5);
73                 break;
74             case Interpolation.exp5In:
75                 process = new InterpolationExpIn(2, 5);
76                 break;
77             case Interpolation.exp5Out:
78                 process = new InterpolationExpOut(2, 5);
79                 break;
80             case Interpolation.elastic:
81                 process = new InterpolationElastic(2, 10);
82                 break;
83             case Interpolation.elasticIn:
84                 process = new InterpolationElasticIn(2, 10);
85                 break;
86             case Interpolation.elasticOut:
87                 process = new InterpolationElasticOut(2, 10);
88                 break;
89             case Interpolation.swing:
90                 process = new InterpolationSwing(1.5f);
91                 break;
92             case Interpolation.swingIn:
93                 process = new InterpolationSwingIn(2);
94                 break;
95             case Interpolation.swingOut:
96                 process = new InterpolationSwingOut(2);
97                 break;
98             case Interpolation.bounce:
99                 process = new InterpolationBounce(4);
100                 break;
101             case Interpolation.bounceIn:
102                 process = new InterpolationBounceIn(4);
103                 break;
104             case Interpolation.bounceOut:
105                 process = new InterpolationBounceOut(4);
106                 break;
107             case Interpolation.fade:
108                 process = new InterpolationFade();
109                 break;
110         }
111         return process;
112     }

Download file with original file name:Process

Process 165 lượt xem

Gõ tìm kiếm nhanh...