XNA中组件之间的变量的访问与赋值问题
来源:互联网 发布:金蝶k3数据引出无反应 编辑:程序博客网 时间:2024/06/05 05:46
When we are developing XNA, getting hang of using XNA Component is very necessary. And I have come across many problems in these days.
Problem. How to realize to swap parameters among different Components ?
Solution: Of course we have a main function and the game start from this .cs file. e.g. we want to give parameter a1 in Component cA to parameter b1 in class cB.
First, instantiate cA and cB as A and B in main file.
Second, realize the swapping in Update() function. Often, we code like this " B.b1 = A.a1". But I get an error tip like this"无法修改类中的结构体成员的属性,提示错误返回值不是一个变量"; In this case, we should declare the b1 like this:
public parameterType b1;
public parameterType _b1
{
get{return b1;}
set{b1 = value};
}
Then the error is solved!
There is still a long way to go...
- XNA中组件之间的变量的访问与赋值问题
- javascript中函数声明、变量声明以及变量赋值之间的关系与影响
- jsp与js之间变量赋值问题
- vb循环中变量赋值的问题
- Java中变量赋值的问题
- Python 中变量的赋值问题
- ES6中变量的解构与赋值
- 在java中 变量之间是如何赋值的
- XMLlistCollection之间的赋值问题
- 关于XNA中视频的问题
- MFC中对话框之间或非对话框与对话框之间的成员变量的访问,获得各类句柄的总结
- XNA组件的Enabled属性
- 关于CString与char *之间的赋值问题
- char数组和指针与CString之间的赋值问题
- 变量的声明与赋值
- makefile 中变量的赋值
- makefile 中变量的赋值
- 如何在SSIS的脚本组件中访问变量
- Redis指令文档
- java URI,URL使用
- object-c 语法
- 日历开发
- 11java 王少飞-多线程总结
- XNA中组件之间的变量的访问与赋值问题
- Servlet生命周期和ServletConfig
- 海豚算法循环左移
- Http响应
- 自制基于arduino的GPS地图导航系统 原型
- 构造函数和析构函数
- Java之多线程面试题
- leeboy的linux学习七awk实例
- SQL*Net more data to client意味着什么