摘要: 1:重载方法: 重载的方法名一样; 重载的方法参数类型不同或是参数数量不同。 注: 方法的返回类型不同不是重载 2:构造函数 a:构造方法名与类名相同 b:没有返回类型; c:一般用public作为访问修饰符; d:功能就是给字段赋值 class Student() { private string 阅读全文
posted @ 2016-07-07 14:49 CocomoNo1 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 1:调用Play类中的StartPlay方法: 语法: 无返回类型的方法调用: 类名 对象名=new 类名(); 对象名.方法名(参数); 有返回类型的方法名调用: 类名 对象名=new 类名(); 返回类型 变量名=对象名.方法名(参数); EG:string str=Console.WriteL 阅读全文
posted @ 2016-07-07 14:41 CocomoNo1 阅读(243) 评论(0) 推荐(0) 编辑
摘要: Project 说明:Content(GameObject)为text的父物体,text用于显示文本内容。ScrollBar为滚动条。 实现效果: Hierarchy: Inspector: 步骤: 1:GameObject新命名为Content,添加Text用于显示文本内容,ScrollBar的设 阅读全文
posted @ 2016-07-06 16:49 CocomoNo1 阅读(4801) 评论(0) 推荐(0) 编辑
摘要: ReviewImg用于显示图片,所挂脚本为ImageName using UnityEngine;using System.Collections; public class ImageName : MonoBehaviour { public string _imageName; } GroupB 阅读全文
posted @ 2016-07-06 10:21 CocomoNo1 阅读(939) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine; using System.Collections; using UnityEngine.EventSystems; public class EventTriggerListener : UnityEngine.EventSystems.EventTrigger { public delegate void VoidDelegate(GameOb... 阅读全文
posted @ 2016-07-05 14:39 CocomoNo1 阅读(611) 评论(0) 推荐(0) 编辑
摘要: 注:Paotai为大炮,所挂载的脚本为Move. using UnityEngine;using System.Collections; public class Move : MonoBehaviour{ public Transform TargetMove;//作为炮口的瞄准目标 privat 阅读全文
posted @ 2016-07-05 14:09 CocomoNo1 阅读(487) 评论(0) 推荐(0) 编辑
摘要: //使用List需添加的命名空间using System.Collections.Generic; //声明元素类型为int类型的List容器 //ToolPic用于盛放图片 public List<GameObject> ToolPic2 = new List<GameObject>(); //T 阅读全文
posted @ 2016-07-02 11:57 CocomoNo1 阅读(294) 评论(0) 推荐(0) 编辑
摘要: Object.Instantiate Object.Instantiate public static Object Instantiate(Object original); public static Object Instantiate(Object original, Vector3 pos 阅读全文
posted @ 2016-07-02 10:41 CocomoNo1 阅读(172) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine;using System.Collections;public class LookForPath : MonoBehaviour{ public Transform[] TargeArr; public bool isBool=false; int i = 0; 阅读全文
posted @ 2016-07-02 09:57 CocomoNo1 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 1. 去除启动exe项目时出现的画面窗口 File ☞ Build Settings ☞Pc and Mac Standalone ☞ Player Settings ☞Resolution and Presentation ☞Display Resolution 选项改为 Dialog Disab 阅读全文
posted @ 2016-07-01 17:17 CocomoNo1 阅读(455) 评论(0) 推荐(0) 编辑